1#![doc = "MAVLink paparazzi dialect."]
2#![doc = ""]
3#![doc = "This file was automatically generated, do not edit."]
4#![allow(deprecated)]
5#[cfg(feature = "arbitrary")]
6use arbitrary::Arbitrary;
7#[allow(unused_imports)]
8use bitflags::bitflags;
9use mavlink_core::{bytes::Bytes, bytes_mut::BytesMut, MavlinkVersion, Message, MessageData};
10#[allow(unused_imports)]
11use num_derive::FromPrimitive;
12#[allow(unused_imports)]
13use num_derive::ToPrimitive;
14#[allow(unused_imports)]
15use num_traits::FromPrimitive;
16#[allow(unused_imports)]
17use num_traits::ToPrimitive;
18#[cfg(feature = "serde")]
19use serde::{Deserialize, Serialize};
20pub const MINOR_MAVLINK_VERSION: u8 = 3u8;
21#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
22#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23#[cfg_attr(feature = "serde", serde(tag = "type"))]
24#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25#[repr(u32)]
26#[doc = "Actuator configuration, used to change a setting on an actuator. Component information metadata can be used to know which outputs support which commands."]
27pub enum ActuatorConfiguration {
28 #[doc = "Do nothing."]
29 ACTUATOR_CONFIGURATION_NONE = 0,
30 #[doc = "Command the actuator to beep now."]
31 ACTUATOR_CONFIGURATION_BEEP = 1,
32 #[doc = "Permanently set the actuator (ESC) to 3D mode (reversible thrust)."]
33 ACTUATOR_CONFIGURATION_3D_MODE_ON = 2,
34 #[doc = "Permanently set the actuator (ESC) to non 3D mode (non-reversible thrust)."]
35 ACTUATOR_CONFIGURATION_3D_MODE_OFF = 3,
36 #[doc = "Permanently set the actuator (ESC) to spin direction 1 (which can be clockwise or counter-clockwise)."]
37 ACTUATOR_CONFIGURATION_SPIN_DIRECTION1 = 4,
38 #[doc = "Permanently set the actuator (ESC) to spin direction 2 (opposite of direction 1)."]
39 ACTUATOR_CONFIGURATION_SPIN_DIRECTION2 = 5,
40}
41impl ActuatorConfiguration {
42 pub const DEFAULT: Self = Self::ACTUATOR_CONFIGURATION_NONE;
43}
44impl Default for ActuatorConfiguration {
45 fn default() -> Self {
46 Self::DEFAULT
47 }
48}
49#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
50#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
51#[cfg_attr(feature = "serde", serde(tag = "type"))]
52#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
53#[repr(u32)]
54#[doc = "Actuator output function. Values greater or equal to 1000 are autopilot-specific."]
55pub enum ActuatorOutputFunction {
56 #[doc = "No function (disabled)."]
57 ACTUATOR_OUTPUT_FUNCTION_NONE = 0,
58 #[doc = "Motor 1"]
59 ACTUATOR_OUTPUT_FUNCTION_MOTOR1 = 1,
60 #[doc = "Motor 2"]
61 ACTUATOR_OUTPUT_FUNCTION_MOTOR2 = 2,
62 #[doc = "Motor 3"]
63 ACTUATOR_OUTPUT_FUNCTION_MOTOR3 = 3,
64 #[doc = "Motor 4"]
65 ACTUATOR_OUTPUT_FUNCTION_MOTOR4 = 4,
66 #[doc = "Motor 5"]
67 ACTUATOR_OUTPUT_FUNCTION_MOTOR5 = 5,
68 #[doc = "Motor 6"]
69 ACTUATOR_OUTPUT_FUNCTION_MOTOR6 = 6,
70 #[doc = "Motor 7"]
71 ACTUATOR_OUTPUT_FUNCTION_MOTOR7 = 7,
72 #[doc = "Motor 8"]
73 ACTUATOR_OUTPUT_FUNCTION_MOTOR8 = 8,
74 #[doc = "Motor 9"]
75 ACTUATOR_OUTPUT_FUNCTION_MOTOR9 = 9,
76 #[doc = "Motor 10"]
77 ACTUATOR_OUTPUT_FUNCTION_MOTOR10 = 10,
78 #[doc = "Motor 11"]
79 ACTUATOR_OUTPUT_FUNCTION_MOTOR11 = 11,
80 #[doc = "Motor 12"]
81 ACTUATOR_OUTPUT_FUNCTION_MOTOR12 = 12,
82 #[doc = "Motor 13"]
83 ACTUATOR_OUTPUT_FUNCTION_MOTOR13 = 13,
84 #[doc = "Motor 14"]
85 ACTUATOR_OUTPUT_FUNCTION_MOTOR14 = 14,
86 #[doc = "Motor 15"]
87 ACTUATOR_OUTPUT_FUNCTION_MOTOR15 = 15,
88 #[doc = "Motor 16"]
89 ACTUATOR_OUTPUT_FUNCTION_MOTOR16 = 16,
90 #[doc = "Servo 1"]
91 ACTUATOR_OUTPUT_FUNCTION_SERVO1 = 33,
92 #[doc = "Servo 2"]
93 ACTUATOR_OUTPUT_FUNCTION_SERVO2 = 34,
94 #[doc = "Servo 3"]
95 ACTUATOR_OUTPUT_FUNCTION_SERVO3 = 35,
96 #[doc = "Servo 4"]
97 ACTUATOR_OUTPUT_FUNCTION_SERVO4 = 36,
98 #[doc = "Servo 5"]
99 ACTUATOR_OUTPUT_FUNCTION_SERVO5 = 37,
100 #[doc = "Servo 6"]
101 ACTUATOR_OUTPUT_FUNCTION_SERVO6 = 38,
102 #[doc = "Servo 7"]
103 ACTUATOR_OUTPUT_FUNCTION_SERVO7 = 39,
104 #[doc = "Servo 8"]
105 ACTUATOR_OUTPUT_FUNCTION_SERVO8 = 40,
106 #[doc = "Servo 9"]
107 ACTUATOR_OUTPUT_FUNCTION_SERVO9 = 41,
108 #[doc = "Servo 10"]
109 ACTUATOR_OUTPUT_FUNCTION_SERVO10 = 42,
110 #[doc = "Servo 11"]
111 ACTUATOR_OUTPUT_FUNCTION_SERVO11 = 43,
112 #[doc = "Servo 12"]
113 ACTUATOR_OUTPUT_FUNCTION_SERVO12 = 44,
114 #[doc = "Servo 13"]
115 ACTUATOR_OUTPUT_FUNCTION_SERVO13 = 45,
116 #[doc = "Servo 14"]
117 ACTUATOR_OUTPUT_FUNCTION_SERVO14 = 46,
118 #[doc = "Servo 15"]
119 ACTUATOR_OUTPUT_FUNCTION_SERVO15 = 47,
120 #[doc = "Servo 16"]
121 ACTUATOR_OUTPUT_FUNCTION_SERVO16 = 48,
122}
123impl ActuatorOutputFunction {
124 pub const DEFAULT: Self = Self::ACTUATOR_OUTPUT_FUNCTION_NONE;
125}
126impl Default for ActuatorOutputFunction {
127 fn default() -> Self {
128 Self::DEFAULT
129 }
130}
131#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
132#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
133#[cfg_attr(feature = "serde", serde(tag = "type"))]
134#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
135#[repr(u32)]
136#[doc = "Enumeration of the ADSB altimeter types"]
137pub enum AdsbAltitudeType {
138 #[doc = "Altitude reported from a Baro source using QNH reference"]
139 ADSB_ALTITUDE_TYPE_PRESSURE_QNH = 0,
140 #[doc = "Altitude reported from a GNSS source"]
141 ADSB_ALTITUDE_TYPE_GEOMETRIC = 1,
142}
143impl AdsbAltitudeType {
144 pub const DEFAULT: Self = Self::ADSB_ALTITUDE_TYPE_PRESSURE_QNH;
145}
146impl Default for AdsbAltitudeType {
147 fn default() -> Self {
148 Self::DEFAULT
149 }
150}
151#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
152#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
153#[cfg_attr(feature = "serde", serde(tag = "type"))]
154#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
155#[repr(u32)]
156#[doc = "ADSB classification for the type of vehicle emitting the transponder signal"]
157pub enum AdsbEmitterType {
158 ADSB_EMITTER_TYPE_NO_INFO = 0,
159 ADSB_EMITTER_TYPE_LIGHT = 1,
160 ADSB_EMITTER_TYPE_SMALL = 2,
161 ADSB_EMITTER_TYPE_LARGE = 3,
162 ADSB_EMITTER_TYPE_HIGH_VORTEX_LARGE = 4,
163 ADSB_EMITTER_TYPE_HEAVY = 5,
164 ADSB_EMITTER_TYPE_HIGHLY_MANUV = 6,
165 ADSB_EMITTER_TYPE_ROTOCRAFT = 7,
166 ADSB_EMITTER_TYPE_UNASSIGNED = 8,
167 ADSB_EMITTER_TYPE_GLIDER = 9,
168 ADSB_EMITTER_TYPE_LIGHTER_AIR = 10,
169 ADSB_EMITTER_TYPE_PARACHUTE = 11,
170 ADSB_EMITTER_TYPE_ULTRA_LIGHT = 12,
171 ADSB_EMITTER_TYPE_UNASSIGNED2 = 13,
172 ADSB_EMITTER_TYPE_UAV = 14,
173 ADSB_EMITTER_TYPE_SPACE = 15,
174 ADSB_EMITTER_TYPE_UNASSGINED3 = 16,
175 ADSB_EMITTER_TYPE_EMERGENCY_SURFACE = 17,
176 ADSB_EMITTER_TYPE_SERVICE_SURFACE = 18,
177 ADSB_EMITTER_TYPE_POINT_OBSTACLE = 19,
178}
179impl AdsbEmitterType {
180 pub const DEFAULT: Self = Self::ADSB_EMITTER_TYPE_NO_INFO;
181}
182impl Default for AdsbEmitterType {
183 fn default() -> Self {
184 Self::DEFAULT
185 }
186}
187bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These flags indicate status such as data validity of each data source. Set = data valid"] pub struct AdsbFlags : u16 { const ADSB_FLAGS_VALID_COORDS = 1 ; const ADSB_FLAGS_VALID_ALTITUDE = 2 ; const ADSB_FLAGS_VALID_HEADING = 4 ; const ADSB_FLAGS_VALID_VELOCITY = 8 ; const ADSB_FLAGS_VALID_CALLSIGN = 16 ; const ADSB_FLAGS_VALID_SQUAWK = 32 ; const ADSB_FLAGS_SIMULATED = 64 ; const ADSB_FLAGS_VERTICAL_VELOCITY_VALID = 128 ; const ADSB_FLAGS_BARO_VALID = 256 ; const ADSB_FLAGS_SOURCE_UAT = 32768 ; } }
188impl AdsbFlags {
189 pub const DEFAULT: Self = Self::ADSB_FLAGS_VALID_COORDS;
190}
191impl Default for AdsbFlags {
192 fn default() -> Self {
193 Self::DEFAULT
194 }
195}
196bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These flags are used in the AIS_VESSEL.fields bitmask to indicate validity of data in the other message fields. When set, the data is valid."] pub struct AisFlags : u16 { # [doc = "1 = Position accuracy less than 10m, 0 = position accuracy greater than 10m."] const AIS_FLAGS_POSITION_ACCURACY = 1 ; const AIS_FLAGS_VALID_COG = 2 ; const AIS_FLAGS_VALID_VELOCITY = 4 ; # [doc = "1 = Velocity over 52.5765m/s (102.2 knots)"] const AIS_FLAGS_HIGH_VELOCITY = 8 ; const AIS_FLAGS_VALID_TURN_RATE = 16 ; # [doc = "Only the sign of the returned turn rate value is valid, either greater than 5deg/30s or less than -5deg/30s"] const AIS_FLAGS_TURN_RATE_SIGN_ONLY = 32 ; const AIS_FLAGS_VALID_DIMENSIONS = 64 ; # [doc = "Distance to bow is larger than 511m"] const AIS_FLAGS_LARGE_BOW_DIMENSION = 128 ; # [doc = "Distance to stern is larger than 511m"] const AIS_FLAGS_LARGE_STERN_DIMENSION = 256 ; # [doc = "Distance to port side is larger than 63m"] const AIS_FLAGS_LARGE_PORT_DIMENSION = 512 ; # [doc = "Distance to starboard side is larger than 63m"] const AIS_FLAGS_LARGE_STARBOARD_DIMENSION = 1024 ; const AIS_FLAGS_VALID_CALLSIGN = 2048 ; const AIS_FLAGS_VALID_NAME = 4096 ; } }
197impl AisFlags {
198 pub const DEFAULT: Self = Self::AIS_FLAGS_POSITION_ACCURACY;
199}
200impl Default for AisFlags {
201 fn default() -> Self {
202 Self::DEFAULT
203 }
204}
205#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
206#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
207#[cfg_attr(feature = "serde", serde(tag = "type"))]
208#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
209#[repr(u32)]
210#[doc = "Navigational status of AIS vessel, enum duplicated from AIS standard, <https://gpsd.gitlab.io/gpsd/AIVDM.html>"]
211pub enum AisNavStatus {
212 #[doc = "Under way using engine."]
213 UNDER_WAY = 0,
214 AIS_NAV_ANCHORED = 1,
215 AIS_NAV_UN_COMMANDED = 2,
216 AIS_NAV_RESTRICTED_MANOEUVERABILITY = 3,
217 AIS_NAV_DRAUGHT_CONSTRAINED = 4,
218 AIS_NAV_MOORED = 5,
219 AIS_NAV_AGROUND = 6,
220 AIS_NAV_FISHING = 7,
221 AIS_NAV_SAILING = 8,
222 AIS_NAV_RESERVED_HSC = 9,
223 AIS_NAV_RESERVED_WIG = 10,
224 AIS_NAV_RESERVED_1 = 11,
225 AIS_NAV_RESERVED_2 = 12,
226 AIS_NAV_RESERVED_3 = 13,
227 #[doc = "Search And Rescue Transponder."]
228 AIS_NAV_AIS_SART = 14,
229 #[doc = "Not available (default)."]
230 AIS_NAV_UNKNOWN = 15,
231}
232impl AisNavStatus {
233 pub const DEFAULT: Self = Self::UNDER_WAY;
234}
235impl Default for AisNavStatus {
236 fn default() -> Self {
237 Self::DEFAULT
238 }
239}
240#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
241#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
242#[cfg_attr(feature = "serde", serde(tag = "type"))]
243#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
244#[repr(u32)]
245#[doc = "Type of AIS vessel, enum duplicated from AIS standard, <https://gpsd.gitlab.io/gpsd/AIVDM.html>"]
246pub enum AisType {
247 #[doc = "Not available (default)."]
248 AIS_TYPE_UNKNOWN = 0,
249 AIS_TYPE_RESERVED_1 = 1,
250 AIS_TYPE_RESERVED_2 = 2,
251 AIS_TYPE_RESERVED_3 = 3,
252 AIS_TYPE_RESERVED_4 = 4,
253 AIS_TYPE_RESERVED_5 = 5,
254 AIS_TYPE_RESERVED_6 = 6,
255 AIS_TYPE_RESERVED_7 = 7,
256 AIS_TYPE_RESERVED_8 = 8,
257 AIS_TYPE_RESERVED_9 = 9,
258 AIS_TYPE_RESERVED_10 = 10,
259 AIS_TYPE_RESERVED_11 = 11,
260 AIS_TYPE_RESERVED_12 = 12,
261 AIS_TYPE_RESERVED_13 = 13,
262 AIS_TYPE_RESERVED_14 = 14,
263 AIS_TYPE_RESERVED_15 = 15,
264 AIS_TYPE_RESERVED_16 = 16,
265 AIS_TYPE_RESERVED_17 = 17,
266 AIS_TYPE_RESERVED_18 = 18,
267 AIS_TYPE_RESERVED_19 = 19,
268 #[doc = "Wing In Ground effect."]
269 AIS_TYPE_WIG = 20,
270 AIS_TYPE_WIG_HAZARDOUS_A = 21,
271 AIS_TYPE_WIG_HAZARDOUS_B = 22,
272 AIS_TYPE_WIG_HAZARDOUS_C = 23,
273 AIS_TYPE_WIG_HAZARDOUS_D = 24,
274 AIS_TYPE_WIG_RESERVED_1 = 25,
275 AIS_TYPE_WIG_RESERVED_2 = 26,
276 AIS_TYPE_WIG_RESERVED_3 = 27,
277 AIS_TYPE_WIG_RESERVED_4 = 28,
278 AIS_TYPE_WIG_RESERVED_5 = 29,
279 AIS_TYPE_FISHING = 30,
280 AIS_TYPE_TOWING = 31,
281 #[doc = "Towing: length exceeds 200m or breadth exceeds 25m."]
282 AIS_TYPE_TOWING_LARGE = 32,
283 #[doc = "Dredging or other underwater ops."]
284 AIS_TYPE_DREDGING = 33,
285 AIS_TYPE_DIVING = 34,
286 AIS_TYPE_MILITARY = 35,
287 AIS_TYPE_SAILING = 36,
288 AIS_TYPE_PLEASURE = 37,
289 AIS_TYPE_RESERVED_20 = 38,
290 AIS_TYPE_RESERVED_21 = 39,
291 #[doc = "High Speed Craft."]
292 AIS_TYPE_HSC = 40,
293 AIS_TYPE_HSC_HAZARDOUS_A = 41,
294 AIS_TYPE_HSC_HAZARDOUS_B = 42,
295 AIS_TYPE_HSC_HAZARDOUS_C = 43,
296 AIS_TYPE_HSC_HAZARDOUS_D = 44,
297 AIS_TYPE_HSC_RESERVED_1 = 45,
298 AIS_TYPE_HSC_RESERVED_2 = 46,
299 AIS_TYPE_HSC_RESERVED_3 = 47,
300 AIS_TYPE_HSC_RESERVED_4 = 48,
301 AIS_TYPE_HSC_UNKNOWN = 49,
302 AIS_TYPE_PILOT = 50,
303 #[doc = "Search And Rescue vessel."]
304 AIS_TYPE_SAR = 51,
305 AIS_TYPE_TUG = 52,
306 AIS_TYPE_PORT_TENDER = 53,
307 #[doc = "Anti-pollution equipment."]
308 AIS_TYPE_ANTI_POLLUTION = 54,
309 AIS_TYPE_LAW_ENFORCEMENT = 55,
310 AIS_TYPE_SPARE_LOCAL_1 = 56,
311 AIS_TYPE_SPARE_LOCAL_2 = 57,
312 AIS_TYPE_MEDICAL_TRANSPORT = 58,
313 #[doc = "Noncombatant ship according to RR Resolution No. 18."]
314 AIS_TYPE_NONECOMBATANT = 59,
315 AIS_TYPE_PASSENGER = 60,
316 AIS_TYPE_PASSENGER_HAZARDOUS_A = 61,
317 AIS_TYPE_PASSENGER_HAZARDOUS_B = 62,
318 AIS_TYPE_PASSENGER_HAZARDOUS_C = 63,
319 AIS_TYPE_PASSENGER_HAZARDOUS_D = 64,
320 AIS_TYPE_PASSENGER_RESERVED_1 = 65,
321 AIS_TYPE_PASSENGER_RESERVED_2 = 66,
322 AIS_TYPE_PASSENGER_RESERVED_3 = 67,
323 AIS_TYPE_PASSENGER_RESERVED_4 = 68,
324 AIS_TYPE_PASSENGER_UNKNOWN = 69,
325 AIS_TYPE_CARGO = 70,
326 AIS_TYPE_CARGO_HAZARDOUS_A = 71,
327 AIS_TYPE_CARGO_HAZARDOUS_B = 72,
328 AIS_TYPE_CARGO_HAZARDOUS_C = 73,
329 AIS_TYPE_CARGO_HAZARDOUS_D = 74,
330 AIS_TYPE_CARGO_RESERVED_1 = 75,
331 AIS_TYPE_CARGO_RESERVED_2 = 76,
332 AIS_TYPE_CARGO_RESERVED_3 = 77,
333 AIS_TYPE_CARGO_RESERVED_4 = 78,
334 AIS_TYPE_CARGO_UNKNOWN = 79,
335 AIS_TYPE_TANKER = 80,
336 AIS_TYPE_TANKER_HAZARDOUS_A = 81,
337 AIS_TYPE_TANKER_HAZARDOUS_B = 82,
338 AIS_TYPE_TANKER_HAZARDOUS_C = 83,
339 AIS_TYPE_TANKER_HAZARDOUS_D = 84,
340 AIS_TYPE_TANKER_RESERVED_1 = 85,
341 AIS_TYPE_TANKER_RESERVED_2 = 86,
342 AIS_TYPE_TANKER_RESERVED_3 = 87,
343 AIS_TYPE_TANKER_RESERVED_4 = 88,
344 AIS_TYPE_TANKER_UNKNOWN = 89,
345 AIS_TYPE_OTHER = 90,
346 AIS_TYPE_OTHER_HAZARDOUS_A = 91,
347 AIS_TYPE_OTHER_HAZARDOUS_B = 92,
348 AIS_TYPE_OTHER_HAZARDOUS_C = 93,
349 AIS_TYPE_OTHER_HAZARDOUS_D = 94,
350 AIS_TYPE_OTHER_RESERVED_1 = 95,
351 AIS_TYPE_OTHER_RESERVED_2 = 96,
352 AIS_TYPE_OTHER_RESERVED_3 = 97,
353 AIS_TYPE_OTHER_RESERVED_4 = 98,
354 AIS_TYPE_OTHER_UNKNOWN = 99,
355}
356impl AisType {
357 pub const DEFAULT: Self = Self::AIS_TYPE_UNKNOWN;
358}
359impl Default for AisType {
360 fn default() -> Self {
361 Self::DEFAULT
362 }
363}
364bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Bitmap to indicate which dimensions should be ignored by the vehicle: a value of 0b00000000 indicates that none of the setpoint dimensions should be ignored."] pub struct AttitudeTargetTypemask : u8 { # [doc = "Ignore body roll rate"] const ATTITUDE_TARGET_TYPEMASK_BODY_ROLL_RATE_IGNORE = 1 ; # [doc = "Ignore body pitch rate"] const ATTITUDE_TARGET_TYPEMASK_BODY_PITCH_RATE_IGNORE = 2 ; # [doc = "Ignore body yaw rate"] const ATTITUDE_TARGET_TYPEMASK_BODY_YAW_RATE_IGNORE = 4 ; # [doc = "Use 3D body thrust setpoint instead of throttle"] const ATTITUDE_TARGET_TYPEMASK_THRUST_BODY_SET = 32 ; # [doc = "Ignore throttle"] const ATTITUDE_TARGET_TYPEMASK_THROTTLE_IGNORE = 64 ; # [doc = "Ignore attitude"] const ATTITUDE_TARGET_TYPEMASK_ATTITUDE_IGNORE = 128 ; } }
365impl AttitudeTargetTypemask {
366 pub const DEFAULT: Self = Self::ATTITUDE_TARGET_TYPEMASK_BODY_ROLL_RATE_IGNORE;
367}
368impl Default for AttitudeTargetTypemask {
369 fn default() -> Self {
370 Self::DEFAULT
371 }
372}
373#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
374#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
375#[cfg_attr(feature = "serde", serde(tag = "type"))]
376#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
377#[repr(u32)]
378#[doc = "Axes that will be autotuned by MAV_CMD_DO_AUTOTUNE_ENABLE. Note that at least one flag must be set in MAV_CMD_DO_AUTOTUNE_ENABLE.param2: if none are set, the flight stack will tune its default set of axes."]
379pub enum AutotuneAxis {
380 #[doc = "Autotune roll axis."]
381 AUTOTUNE_AXIS_ROLL = 1,
382 #[doc = "Autotune pitch axis."]
383 AUTOTUNE_AXIS_PITCH = 2,
384 #[doc = "Autotune yaw axis."]
385 AUTOTUNE_AXIS_YAW = 4,
386}
387impl AutotuneAxis {
388 pub const DEFAULT: Self = Self::AUTOTUNE_AXIS_ROLL;
389}
390impl Default for AutotuneAxis {
391 fn default() -> Self {
392 Self::DEFAULT
393 }
394}
395bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Camera capability flags (Bitmap)"] pub struct CameraCapFlags : u32 { # [doc = "Camera is able to record video"] const CAMERA_CAP_FLAGS_CAPTURE_VIDEO = 1 ; # [doc = "Camera is able to capture images"] const CAMERA_CAP_FLAGS_CAPTURE_IMAGE = 2 ; # [doc = "Camera has separate Video and Image/Photo modes (MAV_CMD_SET_CAMERA_MODE)"] const CAMERA_CAP_FLAGS_HAS_MODES = 4 ; # [doc = "Camera can capture images while in video mode"] const CAMERA_CAP_FLAGS_CAN_CAPTURE_IMAGE_IN_VIDEO_MODE = 8 ; # [doc = "Camera can capture videos while in Photo/Image mode"] const CAMERA_CAP_FLAGS_CAN_CAPTURE_VIDEO_IN_IMAGE_MODE = 16 ; # [doc = "Camera has image survey mode (MAV_CMD_SET_CAMERA_MODE)"] const CAMERA_CAP_FLAGS_HAS_IMAGE_SURVEY_MODE = 32 ; # [doc = "Camera has basic zoom control (MAV_CMD_SET_CAMERA_ZOOM)"] const CAMERA_CAP_FLAGS_HAS_BASIC_ZOOM = 64 ; # [doc = "Camera has basic focus control (MAV_CMD_SET_CAMERA_FOCUS)"] const CAMERA_CAP_FLAGS_HAS_BASIC_FOCUS = 128 ; # [doc = "Camera has video streaming capabilities (request VIDEO_STREAM_INFORMATION with MAV_CMD_REQUEST_MESSAGE for video streaming info)"] const CAMERA_CAP_FLAGS_HAS_VIDEO_STREAM = 256 ; # [doc = "Camera supports tracking of a point on the camera view."] const CAMERA_CAP_FLAGS_HAS_TRACKING_POINT = 512 ; # [doc = "Camera supports tracking of a selection rectangle on the camera view."] const CAMERA_CAP_FLAGS_HAS_TRACKING_RECTANGLE = 1024 ; # [doc = "Camera supports tracking geo status (CAMERA_TRACKING_GEO_STATUS)."] const CAMERA_CAP_FLAGS_HAS_TRACKING_GEO_STATUS = 2048 ; # [doc = "Camera supports absolute thermal range (request CAMERA_THERMAL_RANGE with MAV_CMD_REQUEST_MESSAGE)."] const CAMERA_CAP_FLAGS_HAS_THERMAL_RANGE = 4096 ; } }
396impl CameraCapFlags {
397 pub const DEFAULT: Self = Self::CAMERA_CAP_FLAGS_CAPTURE_VIDEO;
398}
399impl Default for CameraCapFlags {
400 fn default() -> Self {
401 Self::DEFAULT
402 }
403}
404#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
405#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
406#[cfg_attr(feature = "serde", serde(tag = "type"))]
407#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
408#[repr(u32)]
409#[doc = "Camera Modes."]
410pub enum CameraMode {
411 #[doc = "Camera is in image/photo capture mode."]
412 CAMERA_MODE_IMAGE = 0,
413 #[doc = "Camera is in video capture mode."]
414 CAMERA_MODE_VIDEO = 1,
415 #[doc = "Camera is in image survey capture mode. It allows for camera controller to do specific settings for surveys."]
416 CAMERA_MODE_IMAGE_SURVEY = 2,
417}
418impl CameraMode {
419 pub const DEFAULT: Self = Self::CAMERA_MODE_IMAGE;
420}
421impl Default for CameraMode {
422 fn default() -> Self {
423 Self::DEFAULT
424 }
425}
426#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
427#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
428#[cfg_attr(feature = "serde", serde(tag = "type"))]
429#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
430#[repr(u32)]
431#[doc = "Camera sources for MAV_CMD_SET_CAMERA_SOURCE"]
432pub enum CameraSource {
433 #[doc = "Default camera source."]
434 CAMERA_SOURCE_DEFAULT = 0,
435 #[doc = "RGB camera source."]
436 CAMERA_SOURCE_RGB = 1,
437 #[doc = "IR camera source."]
438 CAMERA_SOURCE_IR = 2,
439 #[doc = "NDVI camera source."]
440 CAMERA_SOURCE_NDVI = 3,
441}
442impl CameraSource {
443 pub const DEFAULT: Self = Self::CAMERA_SOURCE_DEFAULT;
444}
445impl Default for CameraSource {
446 fn default() -> Self {
447 Self::DEFAULT
448 }
449}
450#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
451#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
452#[cfg_attr(feature = "serde", serde(tag = "type"))]
453#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
454#[repr(u32)]
455#[doc = "Camera tracking modes"]
456pub enum CameraTrackingMode {
457 #[doc = "Not tracking"]
458 CAMERA_TRACKING_MODE_NONE = 0,
459 #[doc = "Target is a point"]
460 CAMERA_TRACKING_MODE_POINT = 1,
461 #[doc = "Target is a rectangle"]
462 CAMERA_TRACKING_MODE_RECTANGLE = 2,
463}
464impl CameraTrackingMode {
465 pub const DEFAULT: Self = Self::CAMERA_TRACKING_MODE_NONE;
466}
467impl Default for CameraTrackingMode {
468 fn default() -> Self {
469 Self::DEFAULT
470 }
471}
472#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
473#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
474#[cfg_attr(feature = "serde", serde(tag = "type"))]
475#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
476#[repr(u32)]
477#[doc = "Camera tracking status flags"]
478pub enum CameraTrackingStatusFlags {
479 #[doc = "Camera is not tracking"]
480 CAMERA_TRACKING_STATUS_FLAGS_IDLE = 0,
481 #[doc = "Camera is tracking"]
482 CAMERA_TRACKING_STATUS_FLAGS_ACTIVE = 1,
483 #[doc = "Camera tracking in error state"]
484 CAMERA_TRACKING_STATUS_FLAGS_ERROR = 2,
485}
486impl CameraTrackingStatusFlags {
487 pub const DEFAULT: Self = Self::CAMERA_TRACKING_STATUS_FLAGS_IDLE;
488}
489impl Default for CameraTrackingStatusFlags {
490 fn default() -> Self {
491 Self::DEFAULT
492 }
493}
494bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Camera tracking target data (shows where tracked target is within image)"] pub struct CameraTrackingTargetData : u8 { # [doc = "Target data embedded in image data (proprietary)"] const CAMERA_TRACKING_TARGET_DATA_EMBEDDED = 1 ; # [doc = "Target data rendered in image"] const CAMERA_TRACKING_TARGET_DATA_RENDERED = 2 ; # [doc = "Target data within status message (Point or Rectangle)"] const CAMERA_TRACKING_TARGET_DATA_IN_STATUS = 4 ; } }
495impl CameraTrackingTargetData {
496 pub const DEFAULT: Self = Self::CAMERA_TRACKING_TARGET_DATA_EMBEDDED;
497}
498impl Default for CameraTrackingTargetData {
499 fn default() -> Self {
500 Self::DEFAULT
501 }
502}
503#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
504#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
505#[cfg_attr(feature = "serde", serde(tag = "type"))]
506#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
507#[repr(u32)]
508#[doc = "Zoom types for MAV_CMD_SET_CAMERA_ZOOM"]
509pub enum CameraZoomType {
510 #[doc = "Zoom one step increment (-1 for wide, 1 for tele)"]
511 ZOOM_TYPE_STEP = 0,
512 #[doc = "Continuous normalized zoom in/out rate until stopped. Range -1..1, negative: wide, positive: narrow/tele, 0 to stop zooming. Other values should be clipped to the range."]
513 ZOOM_TYPE_CONTINUOUS = 1,
514 #[doc = "Zoom value as proportion of full camera range (a percentage value between 0.0 and 100.0)"]
515 ZOOM_TYPE_RANGE = 2,
516 #[doc = "Zoom value/variable focal length in millimetres. Note that there is no message to get the valid zoom range of the camera, so this can type can only be used for cameras where the zoom range is known (implying that this cannot reliably be used in a GCS for an arbitrary camera)"]
517 ZOOM_TYPE_FOCAL_LENGTH = 3,
518 #[doc = "Zoom value as horizontal field of view in degrees."]
519 ZOOM_TYPE_HORIZONTAL_FOV = 4,
520}
521impl CameraZoomType {
522 pub const DEFAULT: Self = Self::ZOOM_TYPE_STEP;
523}
524impl Default for CameraZoomType {
525 fn default() -> Self {
526 Self::DEFAULT
527 }
528}
529#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
530#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
531#[cfg_attr(feature = "serde", serde(tag = "type"))]
532#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
533#[repr(u32)]
534pub enum CanFilterOp {
535 CAN_FILTER_REPLACE = 0,
536 CAN_FILTER_ADD = 1,
537 CAN_FILTER_REMOVE = 2,
538}
539impl CanFilterOp {
540 pub const DEFAULT: Self = Self::CAN_FILTER_REPLACE;
541}
542impl Default for CanFilterOp {
543 fn default() -> Self {
544 Self::DEFAULT
545 }
546}
547#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
548#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
549#[cfg_attr(feature = "serde", serde(tag = "type"))]
550#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
551#[repr(u32)]
552#[doc = "Possible responses from a CELLULAR_CONFIG message."]
553pub enum CellularConfigResponse {
554 #[doc = "Changes accepted."]
555 CELLULAR_CONFIG_RESPONSE_ACCEPTED = 0,
556 #[doc = "Invalid APN."]
557 CELLULAR_CONFIG_RESPONSE_APN_ERROR = 1,
558 #[doc = "Invalid PIN."]
559 CELLULAR_CONFIG_RESPONSE_PIN_ERROR = 2,
560 #[doc = "Changes rejected."]
561 CELLULAR_CONFIG_RESPONSE_REJECTED = 3,
562 #[doc = "PUK is required to unblock SIM card."]
563 CELLULAR_CONFIG_BLOCKED_PUK_REQUIRED = 4,
564}
565impl CellularConfigResponse {
566 pub const DEFAULT: Self = Self::CELLULAR_CONFIG_RESPONSE_ACCEPTED;
567}
568impl Default for CellularConfigResponse {
569 fn default() -> Self {
570 Self::DEFAULT
571 }
572}
573#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
574#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
575#[cfg_attr(feature = "serde", serde(tag = "type"))]
576#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
577#[repr(u32)]
578#[doc = "These flags are used to diagnose the failure state of CELLULAR_STATUS"]
579pub enum CellularNetworkFailedReason {
580 #[doc = "No error"]
581 CELLULAR_NETWORK_FAILED_REASON_NONE = 0,
582 #[doc = "Error state is unknown"]
583 CELLULAR_NETWORK_FAILED_REASON_UNKNOWN = 1,
584 #[doc = "SIM is required for the modem but missing"]
585 CELLULAR_NETWORK_FAILED_REASON_SIM_MISSING = 2,
586 #[doc = "SIM is available, but not usable for connection"]
587 CELLULAR_NETWORK_FAILED_REASON_SIM_ERROR = 3,
588}
589impl CellularNetworkFailedReason {
590 pub const DEFAULT: Self = Self::CELLULAR_NETWORK_FAILED_REASON_NONE;
591}
592impl Default for CellularNetworkFailedReason {
593 fn default() -> Self {
594 Self::DEFAULT
595 }
596}
597#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
598#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
599#[cfg_attr(feature = "serde", serde(tag = "type"))]
600#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
601#[repr(u32)]
602#[doc = "Cellular network radio type"]
603pub enum CellularNetworkRadioType {
604 CELLULAR_NETWORK_RADIO_TYPE_NONE = 0,
605 CELLULAR_NETWORK_RADIO_TYPE_GSM = 1,
606 CELLULAR_NETWORK_RADIO_TYPE_CDMA = 2,
607 CELLULAR_NETWORK_RADIO_TYPE_WCDMA = 3,
608 CELLULAR_NETWORK_RADIO_TYPE_LTE = 4,
609}
610impl CellularNetworkRadioType {
611 pub const DEFAULT: Self = Self::CELLULAR_NETWORK_RADIO_TYPE_NONE;
612}
613impl Default for CellularNetworkRadioType {
614 fn default() -> Self {
615 Self::DEFAULT
616 }
617}
618#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
619#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
620#[cfg_attr(feature = "serde", serde(tag = "type"))]
621#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
622#[repr(u32)]
623#[doc = "These flags encode the cellular network status"]
624pub enum CellularStatusFlag {
625 #[doc = "State unknown or not reportable."]
626 CELLULAR_STATUS_FLAG_UNKNOWN = 0,
627 #[doc = "Modem is unusable"]
628 CELLULAR_STATUS_FLAG_FAILED = 1,
629 #[doc = "Modem is being initialized"]
630 CELLULAR_STATUS_FLAG_INITIALIZING = 2,
631 #[doc = "Modem is locked"]
632 CELLULAR_STATUS_FLAG_LOCKED = 3,
633 #[doc = "Modem is not enabled and is powered down"]
634 CELLULAR_STATUS_FLAG_DISABLED = 4,
635 #[doc = "Modem is currently transitioning to the CELLULAR_STATUS_FLAG_DISABLED state"]
636 CELLULAR_STATUS_FLAG_DISABLING = 5,
637 #[doc = "Modem is currently transitioning to the CELLULAR_STATUS_FLAG_ENABLED state"]
638 CELLULAR_STATUS_FLAG_ENABLING = 6,
639 #[doc = "Modem is enabled and powered on but not registered with a network provider and not available for data connections"]
640 CELLULAR_STATUS_FLAG_ENABLED = 7,
641 #[doc = "Modem is searching for a network provider to register"]
642 CELLULAR_STATUS_FLAG_SEARCHING = 8,
643 #[doc = "Modem is registered with a network provider, and data connections and messaging may be available for use"]
644 CELLULAR_STATUS_FLAG_REGISTERED = 9,
645 #[doc = "Modem is disconnecting and deactivating the last active packet data bearer. This state will not be entered if more than one packet data bearer is active and one of the active bearers is deactivated"]
646 CELLULAR_STATUS_FLAG_DISCONNECTING = 10,
647 #[doc = "Modem is activating and connecting the first packet data bearer. Subsequent bearer activations when another bearer is already active do not cause this state to be entered"]
648 CELLULAR_STATUS_FLAG_CONNECTING = 11,
649 #[doc = "One or more packet data bearers is active and connected"]
650 CELLULAR_STATUS_FLAG_CONNECTED = 12,
651}
652impl CellularStatusFlag {
653 pub const DEFAULT: Self = Self::CELLULAR_STATUS_FLAG_UNKNOWN;
654}
655impl Default for CellularStatusFlag {
656 fn default() -> Self {
657 Self::DEFAULT
658 }
659}
660#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
661#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
662#[cfg_attr(feature = "serde", serde(tag = "type"))]
663#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
664#[repr(u32)]
665#[doc = "Supported component metadata types. These are used in the \"general\" metadata file returned by COMPONENT_METADATA to provide information about supported metadata types. The types are not used directly in MAVLink messages."]
666pub enum CompMetadataType {
667 #[doc = "General information about the component. General metadata includes information about other metadata types supported by the component. Files of this type must be supported, and must be downloadable from vehicle using a MAVLink FTP URI."]
668 COMP_METADATA_TYPE_GENERAL = 0,
669 #[doc = "Parameter meta data."]
670 COMP_METADATA_TYPE_PARAMETER = 1,
671 #[doc = "Meta data that specifies which commands and command parameters the vehicle supports. (WIP)"]
672 COMP_METADATA_TYPE_COMMANDS = 2,
673 #[doc = "Meta data that specifies external non-MAVLink peripherals."]
674 COMP_METADATA_TYPE_PERIPHERALS = 3,
675 #[doc = "Meta data for the events interface."]
676 COMP_METADATA_TYPE_EVENTS = 4,
677 #[doc = "Meta data for actuator configuration (motors, servos and vehicle geometry) and testing."]
678 COMP_METADATA_TYPE_ACTUATORS = 5,
679}
680impl CompMetadataType {
681 pub const DEFAULT: Self = Self::COMP_METADATA_TYPE_GENERAL;
682}
683impl Default for CompMetadataType {
684 fn default() -> Self {
685 Self::DEFAULT
686 }
687}
688#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
689#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
690#[cfg_attr(feature = "serde", serde(tag = "type"))]
691#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
692#[repr(u32)]
693#[doc = "Indicates the ESC connection type."]
694pub enum EscConnectionType {
695 #[doc = "Traditional PPM ESC."]
696 ESC_CONNECTION_TYPE_PPM = 0,
697 #[doc = "Serial Bus connected ESC."]
698 ESC_CONNECTION_TYPE_SERIAL = 1,
699 #[doc = "One Shot PPM ESC."]
700 ESC_CONNECTION_TYPE_ONESHOT = 2,
701 #[doc = "I2C ESC."]
702 ESC_CONNECTION_TYPE_I2C = 3,
703 #[doc = "CAN-Bus ESC."]
704 ESC_CONNECTION_TYPE_CAN = 4,
705 #[doc = "DShot ESC."]
706 ESC_CONNECTION_TYPE_DSHOT = 5,
707}
708impl EscConnectionType {
709 pub const DEFAULT: Self = Self::ESC_CONNECTION_TYPE_PPM;
710}
711impl Default for EscConnectionType {
712 fn default() -> Self {
713 Self::DEFAULT
714 }
715}
716bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to report ESC failures."] pub struct EscFailureFlags : u16 { # [doc = "Over current failure."] const ESC_FAILURE_OVER_CURRENT = 1 ; # [doc = "Over voltage failure."] const ESC_FAILURE_OVER_VOLTAGE = 2 ; # [doc = "Over temperature failure."] const ESC_FAILURE_OVER_TEMPERATURE = 4 ; # [doc = "Over RPM failure."] const ESC_FAILURE_OVER_RPM = 8 ; # [doc = "Inconsistent command failure i.e. out of bounds."] const ESC_FAILURE_INCONSISTENT_CMD = 16 ; # [doc = "Motor stuck failure."] const ESC_FAILURE_MOTOR_STUCK = 32 ; # [doc = "Generic ESC failure."] const ESC_FAILURE_GENERIC = 64 ; } }
717impl EscFailureFlags {
718 pub const DEFAULT: Self = Self::ESC_FAILURE_OVER_CURRENT;
719}
720impl Default for EscFailureFlags {
721 fn default() -> Self {
722 Self::DEFAULT
723 }
724}
725bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags in ESTIMATOR_STATUS message"] pub struct EstimatorStatusFlags : u16 { # [doc = "True if the attitude estimate is good"] const ESTIMATOR_ATTITUDE = 1 ; # [doc = "True if the horizontal velocity estimate is good"] const ESTIMATOR_VELOCITY_HORIZ = 2 ; # [doc = "True if the vertical velocity estimate is good"] const ESTIMATOR_VELOCITY_VERT = 4 ; # [doc = "True if the horizontal position (relative) estimate is good"] const ESTIMATOR_POS_HORIZ_REL = 8 ; # [doc = "True if the horizontal position (absolute) estimate is good"] const ESTIMATOR_POS_HORIZ_ABS = 16 ; # [doc = "True if the vertical position (absolute) estimate is good"] const ESTIMATOR_POS_VERT_ABS = 32 ; # [doc = "True if the vertical position (above ground) estimate is good"] const ESTIMATOR_POS_VERT_AGL = 64 ; # [doc = "True if the EKF is in a constant position mode and is not using external measurements (eg GPS or optical flow)"] const ESTIMATOR_CONST_POS_MODE = 128 ; # [doc = "True if the EKF has sufficient data to enter a mode that will provide a (relative) position estimate"] const ESTIMATOR_PRED_POS_HORIZ_REL = 256 ; # [doc = "True if the EKF has sufficient data to enter a mode that will provide a (absolute) position estimate"] const ESTIMATOR_PRED_POS_HORIZ_ABS = 512 ; # [doc = "True if the EKF has detected a GPS glitch"] const ESTIMATOR_GPS_GLITCH = 1024 ; # [doc = "True if the EKF has detected bad accelerometer data"] const ESTIMATOR_ACCEL_ERROR = 2048 ; } }
726impl EstimatorStatusFlags {
727 pub const DEFAULT: Self = Self::ESTIMATOR_ATTITUDE;
728}
729impl Default for EstimatorStatusFlags {
730 fn default() -> Self {
731 Self::DEFAULT
732 }
733}
734#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
735#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
736#[cfg_attr(feature = "serde", serde(tag = "type"))]
737#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
738#[repr(u32)]
739#[doc = "List of possible failure type to inject."]
740pub enum FailureType {
741 #[doc = "No failure injected, used to reset a previous failure."]
742 FAILURE_TYPE_OK = 0,
743 #[doc = "Sets unit off, so completely non-responsive."]
744 FAILURE_TYPE_OFF = 1,
745 #[doc = "Unit is stuck e.g. keeps reporting the same value."]
746 FAILURE_TYPE_STUCK = 2,
747 #[doc = "Unit is reporting complete garbage."]
748 FAILURE_TYPE_GARBAGE = 3,
749 #[doc = "Unit is consistently wrong."]
750 FAILURE_TYPE_WRONG = 4,
751 #[doc = "Unit is slow, so e.g. reporting at slower than expected rate."]
752 FAILURE_TYPE_SLOW = 5,
753 #[doc = "Data of unit is delayed in time."]
754 FAILURE_TYPE_DELAYED = 6,
755 #[doc = "Unit is sometimes working, sometimes not."]
756 FAILURE_TYPE_INTERMITTENT = 7,
757}
758impl FailureType {
759 pub const DEFAULT: Self = Self::FAILURE_TYPE_OK;
760}
761impl Default for FailureType {
762 fn default() -> Self {
763 Self::DEFAULT
764 }
765}
766#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
767#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
768#[cfg_attr(feature = "serde", serde(tag = "type"))]
769#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
770#[repr(u32)]
771#[doc = "List of possible units where failures can be injected."]
772pub enum FailureUnit {
773 FAILURE_UNIT_SENSOR_GYRO = 0,
774 FAILURE_UNIT_SENSOR_ACCEL = 1,
775 FAILURE_UNIT_SENSOR_MAG = 2,
776 FAILURE_UNIT_SENSOR_BARO = 3,
777 FAILURE_UNIT_SENSOR_GPS = 4,
778 FAILURE_UNIT_SENSOR_OPTICAL_FLOW = 5,
779 FAILURE_UNIT_SENSOR_VIO = 6,
780 FAILURE_UNIT_SENSOR_DISTANCE_SENSOR = 7,
781 FAILURE_UNIT_SENSOR_AIRSPEED = 8,
782 FAILURE_UNIT_SYSTEM_BATTERY = 100,
783 FAILURE_UNIT_SYSTEM_MOTOR = 101,
784 FAILURE_UNIT_SYSTEM_SERVO = 102,
785 FAILURE_UNIT_SYSTEM_AVOIDANCE = 103,
786 FAILURE_UNIT_SYSTEM_RC_SIGNAL = 104,
787 FAILURE_UNIT_SYSTEM_MAVLINK_SIGNAL = 105,
788}
789impl FailureUnit {
790 pub const DEFAULT: Self = Self::FAILURE_UNIT_SENSOR_GYRO;
791}
792impl Default for FailureUnit {
793 fn default() -> Self {
794 Self::DEFAULT
795 }
796}
797#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
798#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
799#[cfg_attr(feature = "serde", serde(tag = "type"))]
800#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
801#[repr(u32)]
802pub enum FenceBreach {
803 #[doc = "No last fence breach"]
804 FENCE_BREACH_NONE = 0,
805 #[doc = "Breached minimum altitude"]
806 FENCE_BREACH_MINALT = 1,
807 #[doc = "Breached maximum altitude"]
808 FENCE_BREACH_MAXALT = 2,
809 #[doc = "Breached fence boundary"]
810 FENCE_BREACH_BOUNDARY = 3,
811}
812impl FenceBreach {
813 pub const DEFAULT: Self = Self::FENCE_BREACH_NONE;
814}
815impl Default for FenceBreach {
816 fn default() -> Self {
817 Self::DEFAULT
818 }
819}
820#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
821#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
822#[cfg_attr(feature = "serde", serde(tag = "type"))]
823#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
824#[repr(u32)]
825#[doc = "Actions being taken to mitigate/prevent fence breach"]
826pub enum FenceMitigate {
827 #[doc = "Unknown"]
828 FENCE_MITIGATE_UNKNOWN = 0,
829 #[doc = "No actions being taken"]
830 FENCE_MITIGATE_NONE = 1,
831 #[doc = "Velocity limiting active to prevent breach"]
832 FENCE_MITIGATE_VEL_LIMIT = 2,
833}
834impl FenceMitigate {
835 pub const DEFAULT: Self = Self::FENCE_MITIGATE_UNKNOWN;
836}
837impl Default for FenceMitigate {
838 fn default() -> Self {
839 Self::DEFAULT
840 }
841}
842#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
843#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
844#[cfg_attr(feature = "serde", serde(tag = "type"))]
845#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
846#[repr(u32)]
847#[doc = "Fence types to enable or disable when using MAV_CMD_DO_FENCE_ENABLE. Note that at least one of these flags must be set in MAV_CMD_DO_FENCE_ENABLE.param2. If none are set, the flight stack will ignore the field and enable/disable its default set of fences (usually all of them)."]
848pub enum FenceType {
849 #[doc = "Maximum altitude fence"]
850 FENCE_TYPE_ALT_MAX = 1,
851 #[doc = "Circle fence"]
852 FENCE_TYPE_CIRCLE = 2,
853 #[doc = "Polygon fence"]
854 FENCE_TYPE_POLYGON = 4,
855 #[doc = "Minimum altitude fence"]
856 FENCE_TYPE_ALT_MIN = 8,
857}
858impl FenceType {
859 pub const DEFAULT: Self = Self::FENCE_TYPE_ALT_MAX;
860}
861impl Default for FenceType {
862 fn default() -> Self {
863 Self::DEFAULT
864 }
865}
866#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
867#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
868#[cfg_attr(feature = "serde", serde(tag = "type"))]
869#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
870#[repr(u32)]
871#[doc = "These values define the type of firmware release. These values indicate the first version or release of this type. For example the first alpha release would be 64, the second would be 65."]
872pub enum FirmwareVersionType {
873 #[doc = "development release"]
874 FIRMWARE_VERSION_TYPE_DEV = 0,
875 #[doc = "alpha release"]
876 FIRMWARE_VERSION_TYPE_ALPHA = 64,
877 #[doc = "beta release"]
878 FIRMWARE_VERSION_TYPE_BETA = 128,
879 #[doc = "release candidate"]
880 FIRMWARE_VERSION_TYPE_RC = 192,
881 #[doc = "official stable release"]
882 FIRMWARE_VERSION_TYPE_OFFICIAL = 255,
883}
884impl FirmwareVersionType {
885 pub const DEFAULT: Self = Self::FIRMWARE_VERSION_TYPE_DEV;
886}
887impl Default for FirmwareVersionType {
888 fn default() -> Self {
889 Self::DEFAULT
890 }
891}
892bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Gimbal device (low level) capability flags (bitmap)."] pub struct GimbalDeviceCapFlags : u16 { # [doc = "Gimbal device supports a retracted position."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_RETRACT = 1 ; # [doc = "Gimbal device supports a horizontal, forward looking position, stabilized."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_NEUTRAL = 2 ; # [doc = "Gimbal device supports rotating around roll axis."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_AXIS = 4 ; # [doc = "Gimbal device supports to follow a roll angle relative to the vehicle."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_FOLLOW = 8 ; # [doc = "Gimbal device supports locking to a roll angle (generally that's the default with roll stabilized)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_LOCK = 16 ; # [doc = "Gimbal device supports rotating around pitch axis."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_AXIS = 32 ; # [doc = "Gimbal device supports to follow a pitch angle relative to the vehicle."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_FOLLOW = 64 ; # [doc = "Gimbal device supports locking to a pitch angle (generally that's the default with pitch stabilized)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_LOCK = 128 ; # [doc = "Gimbal device supports rotating around yaw axis."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_AXIS = 256 ; # [doc = "Gimbal device supports to follow a yaw angle relative to the vehicle (generally that's the default)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_FOLLOW = 512 ; # [doc = "Gimbal device supports locking to an absolute heading, i.e., yaw angle relative to North (earth frame, often this is an option available)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_LOCK = 1024 ; # [doc = "Gimbal device supports yawing/panning infinitely (e.g. using slip disk)."] const GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_INFINITE_YAW = 2048 ; # [doc = "Gimbal device supports yaw angles and angular velocities relative to North (earth frame). This usually requires support by an autopilot via AUTOPILOT_STATE_FOR_GIMBAL_DEVICE. Support can go on and off during runtime, which is reported by the flag GIMBAL_DEVICE_FLAGS_CAN_ACCEPT_YAW_IN_EARTH_FRAME."] const GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_YAW_IN_EARTH_FRAME = 4096 ; # [doc = "Gimbal device supports radio control inputs as an alternative input for controlling the gimbal orientation."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_RC_INPUTS = 8192 ; } }
893impl GimbalDeviceCapFlags {
894 pub const DEFAULT: Self = Self::GIMBAL_DEVICE_CAP_FLAGS_HAS_RETRACT;
895}
896impl Default for GimbalDeviceCapFlags {
897 fn default() -> Self {
898 Self::DEFAULT
899 }
900}
901bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Gimbal device (low level) error flags (bitmap, 0 means no error)"] pub struct GimbalDeviceErrorFlags : u32 { # [doc = "Gimbal device is limited by hardware roll limit."] const GIMBAL_DEVICE_ERROR_FLAGS_AT_ROLL_LIMIT = 1 ; # [doc = "Gimbal device is limited by hardware pitch limit."] const GIMBAL_DEVICE_ERROR_FLAGS_AT_PITCH_LIMIT = 2 ; # [doc = "Gimbal device is limited by hardware yaw limit."] const GIMBAL_DEVICE_ERROR_FLAGS_AT_YAW_LIMIT = 4 ; # [doc = "There is an error with the gimbal encoders."] const GIMBAL_DEVICE_ERROR_FLAGS_ENCODER_ERROR = 8 ; # [doc = "There is an error with the gimbal power source."] const GIMBAL_DEVICE_ERROR_FLAGS_POWER_ERROR = 16 ; # [doc = "There is an error with the gimbal motors."] const GIMBAL_DEVICE_ERROR_FLAGS_MOTOR_ERROR = 32 ; # [doc = "There is an error with the gimbal's software."] const GIMBAL_DEVICE_ERROR_FLAGS_SOFTWARE_ERROR = 64 ; # [doc = "There is an error with the gimbal's communication."] const GIMBAL_DEVICE_ERROR_FLAGS_COMMS_ERROR = 128 ; # [doc = "Gimbal device is currently calibrating."] const GIMBAL_DEVICE_ERROR_FLAGS_CALIBRATION_RUNNING = 256 ; # [doc = "Gimbal device is not assigned to a gimbal manager."] const GIMBAL_DEVICE_ERROR_FLAGS_NO_MANAGER = 512 ; } }
902impl GimbalDeviceErrorFlags {
903 pub const DEFAULT: Self = Self::GIMBAL_DEVICE_ERROR_FLAGS_AT_ROLL_LIMIT;
904}
905impl Default for GimbalDeviceErrorFlags {
906 fn default() -> Self {
907 Self::DEFAULT
908 }
909}
910bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags for gimbal device (lower level) operation."] pub struct GimbalDeviceFlags : u16 { # [doc = "Set to retracted safe position (no stabilization), takes precedence over all other flags."] const GIMBAL_DEVICE_FLAGS_RETRACT = 1 ; # [doc = "Set to neutral/default position, taking precedence over all other flags except RETRACT. Neutral is commonly forward-facing and horizontal (roll=pitch=yaw=0) but may be any orientation."] const GIMBAL_DEVICE_FLAGS_NEUTRAL = 2 ; # [doc = "Lock roll angle to absolute angle relative to horizon (not relative to vehicle). This is generally the default with a stabilizing gimbal."] const GIMBAL_DEVICE_FLAGS_ROLL_LOCK = 4 ; # [doc = "Lock pitch angle to absolute angle relative to horizon (not relative to vehicle). This is generally the default with a stabilizing gimbal."] const GIMBAL_DEVICE_FLAGS_PITCH_LOCK = 8 ; # [doc = "Lock yaw angle to absolute angle relative to North (not relative to vehicle). If this flag is set, the yaw angle and z component of angular velocity are relative to North (earth frame, x-axis pointing North), else they are relative to the vehicle heading (vehicle frame, earth frame rotated so that the x-axis is pointing forward)."] const GIMBAL_DEVICE_FLAGS_YAW_LOCK = 16 ; # [doc = "Yaw angle and z component of angular velocity are relative to the vehicle heading (vehicle frame, earth frame rotated such that the x-axis is pointing forward)."] const GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME = 32 ; # [doc = "Yaw angle and z component of angular velocity are relative to North (earth frame, x-axis is pointing North)."] const GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME = 64 ; # [doc = "Gimbal device can accept yaw angle inputs relative to North (earth frame). This flag is only for reporting (attempts to set this flag are ignored)."] const GIMBAL_DEVICE_FLAGS_ACCEPTS_YAW_IN_EARTH_FRAME = 128 ; # [doc = "The gimbal orientation is set exclusively by the RC signals feed to the gimbal's radio control inputs. MAVLink messages for setting the gimbal orientation (GIMBAL_DEVICE_SET_ATTITUDE) are ignored."] const GIMBAL_DEVICE_FLAGS_RC_EXCLUSIVE = 256 ; # [doc = "The gimbal orientation is determined by combining/mixing the RC signals feed to the gimbal's radio control inputs and the MAVLink messages for setting the gimbal orientation (GIMBAL_DEVICE_SET_ATTITUDE). How these two controls are combined or mixed is not defined by the protocol but is up to the implementation."] const GIMBAL_DEVICE_FLAGS_RC_MIXED = 512 ; } }
911impl GimbalDeviceFlags {
912 pub const DEFAULT: Self = Self::GIMBAL_DEVICE_FLAGS_RETRACT;
913}
914impl Default for GimbalDeviceFlags {
915 fn default() -> Self {
916 Self::DEFAULT
917 }
918}
919bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Gimbal manager high level capability flags (bitmap). The first 16 bits are identical to the GIMBAL_DEVICE_CAP_FLAGS. However, the gimbal manager does not need to copy the flags from the gimbal but can also enhance the capabilities and thus add flags."] pub struct GimbalManagerCapFlags : u32 { # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_RETRACT."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_RETRACT = 1 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_NEUTRAL."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_NEUTRAL = 2 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_AXIS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_ROLL_AXIS = 4 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_FOLLOW."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_ROLL_FOLLOW = 8 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_LOCK."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_ROLL_LOCK = 16 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_AXIS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_PITCH_AXIS = 32 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_FOLLOW."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_PITCH_FOLLOW = 64 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_LOCK."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_PITCH_LOCK = 128 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_AXIS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_YAW_AXIS = 256 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_FOLLOW."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_YAW_FOLLOW = 512 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_LOCK."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_YAW_LOCK = 1024 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_INFINITE_YAW."] const GIMBAL_MANAGER_CAP_FLAGS_SUPPORTS_INFINITE_YAW = 2048 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_YAW_IN_EARTH_FRAME."] const GIMBAL_MANAGER_CAP_FLAGS_SUPPORTS_YAW_IN_EARTH_FRAME = 4096 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_RC_INPUTS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_RC_INPUTS = 8192 ; # [doc = "Gimbal manager supports to point to a local position."] const GIMBAL_MANAGER_CAP_FLAGS_CAN_POINT_LOCATION_LOCAL = 65536 ; # [doc = "Gimbal manager supports to point to a global latitude, longitude, altitude position."] const GIMBAL_MANAGER_CAP_FLAGS_CAN_POINT_LOCATION_GLOBAL = 131072 ; } }
920impl GimbalManagerCapFlags {
921 pub const DEFAULT: Self = Self::GIMBAL_MANAGER_CAP_FLAGS_HAS_RETRACT;
922}
923impl Default for GimbalManagerCapFlags {
924 fn default() -> Self {
925 Self::DEFAULT
926 }
927}
928bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags for high level gimbal manager operation The first 16 bits are identical to the GIMBAL_DEVICE_FLAGS."] pub struct GimbalManagerFlags : u32 { # [doc = "Based on GIMBAL_DEVICE_FLAGS_RETRACT."] const GIMBAL_MANAGER_FLAGS_RETRACT = 1 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_NEUTRAL."] const GIMBAL_MANAGER_FLAGS_NEUTRAL = 2 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_ROLL_LOCK."] const GIMBAL_MANAGER_FLAGS_ROLL_LOCK = 4 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_PITCH_LOCK."] const GIMBAL_MANAGER_FLAGS_PITCH_LOCK = 8 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_YAW_LOCK."] const GIMBAL_MANAGER_FLAGS_YAW_LOCK = 16 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME."] const GIMBAL_MANAGER_FLAGS_YAW_IN_VEHICLE_FRAME = 32 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME."] const GIMBAL_MANAGER_FLAGS_YAW_IN_EARTH_FRAME = 64 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_ACCEPTS_YAW_IN_EARTH_FRAME."] const GIMBAL_MANAGER_FLAGS_ACCEPTS_YAW_IN_EARTH_FRAME = 128 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_RC_EXCLUSIVE."] const GIMBAL_MANAGER_FLAGS_RC_EXCLUSIVE = 256 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_RC_MIXED."] const GIMBAL_MANAGER_FLAGS_RC_MIXED = 512 ; } }
929impl GimbalManagerFlags {
930 pub const DEFAULT: Self = Self::GIMBAL_MANAGER_FLAGS_RETRACT;
931}
932impl Default for GimbalManagerFlags {
933 fn default() -> Self {
934 Self::DEFAULT
935 }
936}
937#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
938#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
939#[cfg_attr(feature = "serde", serde(tag = "type"))]
940#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
941#[repr(u32)]
942#[doc = "Type of GPS fix"]
943pub enum GpsFixType {
944 #[doc = "No GPS connected"]
945 GPS_FIX_TYPE_NO_GPS = 0,
946 #[doc = "No position information, GPS is connected"]
947 GPS_FIX_TYPE_NO_FIX = 1,
948 #[doc = "2D position"]
949 GPS_FIX_TYPE_2D_FIX = 2,
950 #[doc = "3D position"]
951 GPS_FIX_TYPE_3D_FIX = 3,
952 #[doc = "DGPS/SBAS aided 3D position"]
953 GPS_FIX_TYPE_DGPS = 4,
954 #[doc = "RTK float, 3D position"]
955 GPS_FIX_TYPE_RTK_FLOAT = 5,
956 #[doc = "RTK Fixed, 3D position"]
957 GPS_FIX_TYPE_RTK_FIXED = 6,
958 #[doc = "Static fixed, typically used for base stations"]
959 GPS_FIX_TYPE_STATIC = 7,
960 #[doc = "PPP, 3D position."]
961 GPS_FIX_TYPE_PPP = 8,
962}
963impl GpsFixType {
964 pub const DEFAULT: Self = Self::GPS_FIX_TYPE_NO_GPS;
965}
966impl Default for GpsFixType {
967 fn default() -> Self {
968 Self::DEFAULT
969 }
970}
971bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] pub struct GpsInputIgnoreFlags : u16 { # [doc = "ignore altitude field"] const GPS_INPUT_IGNORE_FLAG_ALT = 1 ; # [doc = "ignore hdop field"] const GPS_INPUT_IGNORE_FLAG_HDOP = 2 ; # [doc = "ignore vdop field"] const GPS_INPUT_IGNORE_FLAG_VDOP = 4 ; # [doc = "ignore horizontal velocity field (vn and ve)"] const GPS_INPUT_IGNORE_FLAG_VEL_HORIZ = 8 ; # [doc = "ignore vertical velocity field (vd)"] const GPS_INPUT_IGNORE_FLAG_VEL_VERT = 16 ; # [doc = "ignore speed accuracy field"] const GPS_INPUT_IGNORE_FLAG_SPEED_ACCURACY = 32 ; # [doc = "ignore horizontal accuracy field"] const GPS_INPUT_IGNORE_FLAG_HORIZONTAL_ACCURACY = 64 ; # [doc = "ignore vertical accuracy field"] const GPS_INPUT_IGNORE_FLAG_VERTICAL_ACCURACY = 128 ; } }
972impl GpsInputIgnoreFlags {
973 pub const DEFAULT: Self = Self::GPS_INPUT_IGNORE_FLAG_ALT;
974}
975impl Default for GpsInputIgnoreFlags {
976 fn default() -> Self {
977 Self::DEFAULT
978 }
979}
980#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
981#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
982#[cfg_attr(feature = "serde", serde(tag = "type"))]
983#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
984#[repr(u32)]
985#[doc = "Gripper actions."]
986pub enum GripperActions {
987 #[doc = "Gripper release cargo."]
988 GRIPPER_ACTION_RELEASE = 0,
989 #[doc = "Gripper grab onto cargo."]
990 GRIPPER_ACTION_GRAB = 1,
991}
992impl GripperActions {
993 pub const DEFAULT: Self = Self::GRIPPER_ACTION_RELEASE;
994}
995impl Default for GripperActions {
996 fn default() -> Self {
997 Self::DEFAULT
998 }
999}
1000bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags in the HIGHRES_IMU message indicate which fields have updated since the last message"] pub struct HighresImuUpdatedFlags : u16 { # [doc = "The value in the xacc field has been updated"] const HIGHRES_IMU_UPDATED_XACC = 1 ; # [doc = "The value in the yacc field has been updated"] const HIGHRES_IMU_UPDATED_YACC = 2 ; # [doc = "The value in the zacc field has been updated since"] const HIGHRES_IMU_UPDATED_ZACC = 4 ; # [doc = "The value in the xgyro field has been updated"] const HIGHRES_IMU_UPDATED_XGYRO = 8 ; # [doc = "The value in the ygyro field has been updated"] const HIGHRES_IMU_UPDATED_YGYRO = 16 ; # [doc = "The value in the zgyro field has been updated"] const HIGHRES_IMU_UPDATED_ZGYRO = 32 ; # [doc = "The value in the xmag field has been updated"] const HIGHRES_IMU_UPDATED_XMAG = 64 ; # [doc = "The value in the ymag field has been updated"] const HIGHRES_IMU_UPDATED_YMAG = 128 ; # [doc = "The value in the zmag field has been updated"] const HIGHRES_IMU_UPDATED_ZMAG = 256 ; # [doc = "The value in the abs_pressure field has been updated"] const HIGHRES_IMU_UPDATED_ABS_PRESSURE = 512 ; # [doc = "The value in the diff_pressure field has been updated"] const HIGHRES_IMU_UPDATED_DIFF_PRESSURE = 1024 ; # [doc = "The value in the pressure_alt field has been updated"] const HIGHRES_IMU_UPDATED_PRESSURE_ALT = 2048 ; # [doc = "The value in the temperature field has been updated"] const HIGHRES_IMU_UPDATED_TEMPERATURE = 4096 ; } }
1001impl HighresImuUpdatedFlags {
1002 pub const DEFAULT: Self = Self::HIGHRES_IMU_UPDATED_XACC;
1003}
1004impl Default for HighresImuUpdatedFlags {
1005 fn default() -> Self {
1006 Self::DEFAULT
1007 }
1008}
1009bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags used in HIL_ACTUATOR_CONTROLS message."] pub struct HilActuatorControlsFlags : u64 { # [doc = "Simulation is using lockstep"] const HIL_ACTUATOR_CONTROLS_FLAGS_LOCKSTEP = 1 ; } }
1010impl HilActuatorControlsFlags {
1011 pub const DEFAULT: Self = Self::HIL_ACTUATOR_CONTROLS_FLAGS_LOCKSTEP;
1012}
1013impl Default for HilActuatorControlsFlags {
1014 fn default() -> Self {
1015 Self::DEFAULT
1016 }
1017}
1018bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags in the HIL_SENSOR message indicate which fields have updated since the last message"] pub struct HilSensorUpdatedFlags : u32 { # [doc = "The value in the xacc field has been updated"] const HIL_SENSOR_UPDATED_XACC = 1 ; # [doc = "The value in the yacc field has been updated"] const HIL_SENSOR_UPDATED_YACC = 2 ; # [doc = "The value in the zacc field has been updated"] const HIL_SENSOR_UPDATED_ZACC = 4 ; # [doc = "The value in the xgyro field has been updated"] const HIL_SENSOR_UPDATED_XGYRO = 8 ; # [doc = "The value in the ygyro field has been updated"] const HIL_SENSOR_UPDATED_YGYRO = 16 ; # [doc = "The value in the zgyro field has been updated"] const HIL_SENSOR_UPDATED_ZGYRO = 32 ; # [doc = "The value in the xmag field has been updated"] const HIL_SENSOR_UPDATED_XMAG = 64 ; # [doc = "The value in the ymag field has been updated"] const HIL_SENSOR_UPDATED_YMAG = 128 ; # [doc = "The value in the zmag field has been updated"] const HIL_SENSOR_UPDATED_ZMAG = 256 ; # [doc = "The value in the abs_pressure field has been updated"] const HIL_SENSOR_UPDATED_ABS_PRESSURE = 512 ; # [doc = "The value in the diff_pressure field has been updated"] const HIL_SENSOR_UPDATED_DIFF_PRESSURE = 1024 ; # [doc = "The value in the pressure_alt field has been updated"] const HIL_SENSOR_UPDATED_PRESSURE_ALT = 2048 ; # [doc = "The value in the temperature field has been updated"] const HIL_SENSOR_UPDATED_TEMPERATURE = 4096 ; # [doc = "Full reset of attitude/position/velocities/etc was performed in sim (Bit 31)."] const HIL_SENSOR_UPDATED_RESET = 2147483648 ; } }
1019impl HilSensorUpdatedFlags {
1020 pub const DEFAULT: Self = Self::HIL_SENSOR_UPDATED_XACC;
1021}
1022impl Default for HilSensorUpdatedFlags {
1023 fn default() -> Self {
1024 Self::DEFAULT
1025 }
1026}
1027bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to report failure cases over the high latency telemetry."] pub struct HlFailureFlag : u16 { # [doc = "GPS failure."] const HL_FAILURE_FLAG_GPS = 1 ; # [doc = "Differential pressure sensor failure."] const HL_FAILURE_FLAG_DIFFERENTIAL_PRESSURE = 2 ; # [doc = "Absolute pressure sensor failure."] const HL_FAILURE_FLAG_ABSOLUTE_PRESSURE = 4 ; # [doc = "Accelerometer sensor failure."] const HL_FAILURE_FLAG_3D_ACCEL = 8 ; # [doc = "Gyroscope sensor failure."] const HL_FAILURE_FLAG_3D_GYRO = 16 ; # [doc = "Magnetometer sensor failure."] const HL_FAILURE_FLAG_3D_MAG = 32 ; # [doc = "Terrain subsystem failure."] const HL_FAILURE_FLAG_TERRAIN = 64 ; # [doc = "Battery failure/critical low battery."] const HL_FAILURE_FLAG_BATTERY = 128 ; # [doc = "RC receiver failure/no RC connection."] const HL_FAILURE_FLAG_RC_RECEIVER = 256 ; # [doc = "Offboard link failure."] const HL_FAILURE_FLAG_OFFBOARD_LINK = 512 ; # [doc = "Engine failure."] const HL_FAILURE_FLAG_ENGINE = 1024 ; # [doc = "Geofence violation."] const HL_FAILURE_FLAG_GEOFENCE = 2048 ; # [doc = "Estimator failure, for example measurement rejection or large variances."] const HL_FAILURE_FLAG_ESTIMATOR = 4096 ; # [doc = "Mission failure."] const HL_FAILURE_FLAG_MISSION = 8192 ; } }
1028impl HlFailureFlag {
1029 pub const DEFAULT: Self = Self::HL_FAILURE_FLAG_GPS;
1030}
1031impl Default for HlFailureFlag {
1032 fn default() -> Self {
1033 Self::DEFAULT
1034 }
1035}
1036bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Illuminator module error flags (bitmap, 0 means no error)"] pub struct IlluminatorErrorFlags : u32 { # [doc = "Illuminator thermal throttling error."] const ILLUMINATOR_ERROR_FLAGS_THERMAL_THROTTLING = 1 ; # [doc = "Illuminator over temperature shutdown error."] const ILLUMINATOR_ERROR_FLAGS_OVER_TEMPERATURE_SHUTDOWN = 2 ; # [doc = "Illuminator thermistor failure."] const ILLUMINATOR_ERROR_FLAGS_THERMISTOR_FAILURE = 4 ; } }
1037impl IlluminatorErrorFlags {
1038 pub const DEFAULT: Self = Self::ILLUMINATOR_ERROR_FLAGS_THERMAL_THROTTLING;
1039}
1040impl Default for IlluminatorErrorFlags {
1041 fn default() -> Self {
1042 Self::DEFAULT
1043 }
1044}
1045#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1046#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1047#[cfg_attr(feature = "serde", serde(tag = "type"))]
1048#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1049#[repr(u32)]
1050#[doc = "Modes of illuminator"]
1051pub enum IlluminatorMode {
1052 #[doc = "Illuminator mode is not specified/unknown"]
1053 ILLUMINATOR_MODE_UNKNOWN = 0,
1054 #[doc = "Illuminator behavior is controlled by MAV_CMD_DO_ILLUMINATOR_CONFIGURE settings"]
1055 ILLUMINATOR_MODE_INTERNAL_CONTROL = 1,
1056 #[doc = "Illuminator behavior is controlled by external factors: e.g. an external hardware signal"]
1057 ILLUMINATOR_MODE_EXTERNAL_SYNC = 2,
1058}
1059impl IlluminatorMode {
1060 pub const DEFAULT: Self = Self::ILLUMINATOR_MODE_UNKNOWN;
1061}
1062impl Default for IlluminatorMode {
1063 fn default() -> Self {
1064 Self::DEFAULT
1065 }
1066}
1067#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1068#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1069#[cfg_attr(feature = "serde", serde(tag = "type"))]
1070#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1071#[repr(u32)]
1072#[doc = "Type of landing target"]
1073pub enum LandingTargetType {
1074 #[doc = "Landing target signaled by light beacon (ex: IR-LOCK)"]
1075 LANDING_TARGET_TYPE_LIGHT_BEACON = 0,
1076 #[doc = "Landing target signaled by radio beacon (ex: ILS, NDB)"]
1077 LANDING_TARGET_TYPE_RADIO_BEACON = 1,
1078 #[doc = "Landing target represented by a fiducial marker (ex: ARTag)"]
1079 LANDING_TARGET_TYPE_VISION_FIDUCIAL = 2,
1080 #[doc = "Landing target represented by a pre-defined visual shape/feature (ex: X-marker, H-marker, square)"]
1081 LANDING_TARGET_TYPE_VISION_OTHER = 3,
1082}
1083impl LandingTargetType {
1084 pub const DEFAULT: Self = Self::LANDING_TARGET_TYPE_LIGHT_BEACON;
1085}
1086impl Default for LandingTargetType {
1087 fn default() -> Self {
1088 Self::DEFAULT
1089 }
1090}
1091#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1092#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1093#[cfg_attr(feature = "serde", serde(tag = "type"))]
1094#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1095#[repr(u32)]
1096pub enum MagCalStatus {
1097 MAG_CAL_NOT_STARTED = 0,
1098 MAG_CAL_WAITING_TO_START = 1,
1099 MAG_CAL_RUNNING_STEP_ONE = 2,
1100 MAG_CAL_RUNNING_STEP_TWO = 3,
1101 MAG_CAL_SUCCESS = 4,
1102 MAG_CAL_FAILED = 5,
1103 MAG_CAL_BAD_ORIENTATION = 6,
1104 MAG_CAL_BAD_RADIUS = 7,
1105}
1106impl MagCalStatus {
1107 pub const DEFAULT: Self = Self::MAG_CAL_NOT_STARTED;
1108}
1109impl Default for MagCalStatus {
1110 fn default() -> Self {
1111 Self::DEFAULT
1112 }
1113}
1114#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1115#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1116#[cfg_attr(feature = "serde", serde(tag = "type"))]
1117#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1118#[repr(u32)]
1119pub enum MavArmAuthDeniedReason {
1120 #[doc = "Not a specific reason"]
1121 MAV_ARM_AUTH_DENIED_REASON_GENERIC = 0,
1122 #[doc = "Authorizer will send the error as string to GCS"]
1123 MAV_ARM_AUTH_DENIED_REASON_NONE = 1,
1124 #[doc = "At least one waypoint have a invalid value"]
1125 MAV_ARM_AUTH_DENIED_REASON_INVALID_WAYPOINT = 2,
1126 #[doc = "Timeout in the authorizer process(in case it depends on network)"]
1127 MAV_ARM_AUTH_DENIED_REASON_TIMEOUT = 3,
1128 #[doc = "Airspace of the mission in use by another vehicle, second result parameter can have the waypoint id that caused it to be denied."]
1129 MAV_ARM_AUTH_DENIED_REASON_AIRSPACE_IN_USE = 4,
1130 #[doc = "Weather is not good to fly"]
1131 MAV_ARM_AUTH_DENIED_REASON_BAD_WEATHER = 5,
1132}
1133impl MavArmAuthDeniedReason {
1134 pub const DEFAULT: Self = Self::MAV_ARM_AUTH_DENIED_REASON_GENERIC;
1135}
1136impl Default for MavArmAuthDeniedReason {
1137 fn default() -> Self {
1138 Self::DEFAULT
1139 }
1140}
1141#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1142#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1143#[cfg_attr(feature = "serde", serde(tag = "type"))]
1144#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1145#[repr(u32)]
1146#[doc = "Micro air vehicle / autopilot classes. This identifies the individual model."]
1147pub enum MavAutopilot {
1148 #[doc = "Generic autopilot, full support for everything"]
1149 MAV_AUTOPILOT_GENERIC = 0,
1150 #[doc = "Reserved for future use."]
1151 MAV_AUTOPILOT_RESERVED = 1,
1152 #[doc = "SLUGS autopilot, <http://slugsuav.soe.ucsc.edu>"]
1153 MAV_AUTOPILOT_SLUGS = 2,
1154 #[doc = "ArduPilot - Plane/Copter/Rover/Sub/Tracker, <https://ardupilot.org>"]
1155 MAV_AUTOPILOT_ARDUPILOTMEGA = 3,
1156 #[doc = "OpenPilot, <http://openpilot.org>"]
1157 MAV_AUTOPILOT_OPENPILOT = 4,
1158 #[doc = "Generic autopilot only supporting simple waypoints"]
1159 MAV_AUTOPILOT_GENERIC_WAYPOINTS_ONLY = 5,
1160 #[doc = "Generic autopilot supporting waypoints and other simple navigation commands"]
1161 MAV_AUTOPILOT_GENERIC_WAYPOINTS_AND_SIMPLE_NAVIGATION_ONLY = 6,
1162 #[doc = "Generic autopilot supporting the full mission command set"]
1163 MAV_AUTOPILOT_GENERIC_MISSION_FULL = 7,
1164 #[doc = "No valid autopilot, e.g. a GCS or other MAVLink component"]
1165 MAV_AUTOPILOT_INVALID = 8,
1166 #[doc = "PPZ UAV - <http://nongnu.org/paparazzi>"]
1167 MAV_AUTOPILOT_PPZ = 9,
1168 #[doc = "UAV Dev Board"]
1169 MAV_AUTOPILOT_UDB = 10,
1170 #[doc = "FlexiPilot"]
1171 MAV_AUTOPILOT_FP = 11,
1172 #[doc = "PX4 Autopilot - <http://px4.io/>"]
1173 MAV_AUTOPILOT_PX4 = 12,
1174 #[doc = "SMACCMPilot - <http://smaccmpilot.org>"]
1175 MAV_AUTOPILOT_SMACCMPILOT = 13,
1176 #[doc = "AutoQuad -- <http://autoquad.org>"]
1177 MAV_AUTOPILOT_AUTOQUAD = 14,
1178 #[doc = "Armazila -- <http://armazila.com>"]
1179 MAV_AUTOPILOT_ARMAZILA = 15,
1180 #[doc = "Aerob -- <http://aerob.ru>"]
1181 MAV_AUTOPILOT_AEROB = 16,
1182 #[doc = "ASLUAV autopilot -- <http://www.asl.ethz.ch>"]
1183 MAV_AUTOPILOT_ASLUAV = 17,
1184 #[doc = "SmartAP Autopilot - <http://sky-drones.com>"]
1185 MAV_AUTOPILOT_SMARTAP = 18,
1186 #[doc = "AirRails - <http://uaventure.com>"]
1187 MAV_AUTOPILOT_AIRRAILS = 19,
1188 #[doc = "Fusion Reflex - <https://fusion.engineering>"]
1189 MAV_AUTOPILOT_REFLEX = 20,
1190}
1191impl MavAutopilot {
1192 pub const DEFAULT: Self = Self::MAV_AUTOPILOT_GENERIC;
1193}
1194impl Default for MavAutopilot {
1195 fn default() -> Self {
1196 Self::DEFAULT
1197 }
1198}
1199#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1200#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1201#[cfg_attr(feature = "serde", serde(tag = "type"))]
1202#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1203#[repr(u32)]
1204#[doc = "Enumeration for battery charge states."]
1205pub enum MavBatteryChargeState {
1206 #[doc = "Low battery state is not provided"]
1207 MAV_BATTERY_CHARGE_STATE_UNDEFINED = 0,
1208 #[doc = "Battery is not in low state. Normal operation."]
1209 MAV_BATTERY_CHARGE_STATE_OK = 1,
1210 #[doc = "Battery state is low, warn and monitor close."]
1211 MAV_BATTERY_CHARGE_STATE_LOW = 2,
1212 #[doc = "Battery state is critical, return or abort immediately."]
1213 MAV_BATTERY_CHARGE_STATE_CRITICAL = 3,
1214 #[doc = "Battery state is too low for ordinary abort sequence. Perform fastest possible emergency stop to prevent damage."]
1215 MAV_BATTERY_CHARGE_STATE_EMERGENCY = 4,
1216 #[doc = "Battery failed, damage unavoidable. Possible causes (faults) are listed in MAV_BATTERY_FAULT."]
1217 MAV_BATTERY_CHARGE_STATE_FAILED = 5,
1218 #[doc = "Battery is diagnosed to be defective or an error occurred, usage is discouraged / prohibited. Possible causes (faults) are listed in MAV_BATTERY_FAULT."]
1219 MAV_BATTERY_CHARGE_STATE_UNHEALTHY = 6,
1220 #[doc = "Battery is charging."]
1221 MAV_BATTERY_CHARGE_STATE_CHARGING = 7,
1222}
1223impl MavBatteryChargeState {
1224 pub const DEFAULT: Self = Self::MAV_BATTERY_CHARGE_STATE_UNDEFINED;
1225}
1226impl Default for MavBatteryChargeState {
1227 fn default() -> Self {
1228 Self::DEFAULT
1229 }
1230}
1231bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Smart battery supply status/fault flags (bitmask) for health indication. The battery must also report either MAV_BATTERY_CHARGE_STATE_FAILED or MAV_BATTERY_CHARGE_STATE_UNHEALTHY if any of these are set."] pub struct MavBatteryFault : u32 { # [doc = "Battery has deep discharged."] const MAV_BATTERY_FAULT_DEEP_DISCHARGE = 1 ; # [doc = "Voltage spikes."] const MAV_BATTERY_FAULT_SPIKES = 2 ; # [doc = "One or more cells have failed. Battery should also report MAV_BATTERY_CHARGE_STATE_FAILE (and should not be used)."] const MAV_BATTERY_FAULT_CELL_FAIL = 4 ; # [doc = "Over-current fault."] const MAV_BATTERY_FAULT_OVER_CURRENT = 8 ; # [doc = "Over-temperature fault."] const MAV_BATTERY_FAULT_OVER_TEMPERATURE = 16 ; # [doc = "Under-temperature fault."] const MAV_BATTERY_FAULT_UNDER_TEMPERATURE = 32 ; # [doc = "Vehicle voltage is not compatible with this battery (batteries on same power rail should have similar voltage)."] const MAV_BATTERY_FAULT_INCOMPATIBLE_VOLTAGE = 64 ; # [doc = "Battery firmware is not compatible with current autopilot firmware."] const MAV_BATTERY_FAULT_INCOMPATIBLE_FIRMWARE = 128 ; # [doc = "Battery is not compatible due to cell configuration (e.g. 5s1p when vehicle requires 6s)."] const BATTERY_FAULT_INCOMPATIBLE_CELLS_CONFIGURATION = 256 ; } }
1232impl MavBatteryFault {
1233 pub const DEFAULT: Self = Self::MAV_BATTERY_FAULT_DEEP_DISCHARGE;
1234}
1235impl Default for MavBatteryFault {
1236 fn default() -> Self {
1237 Self::DEFAULT
1238 }
1239}
1240#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1241#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1242#[cfg_attr(feature = "serde", serde(tag = "type"))]
1243#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1244#[repr(u32)]
1245#[doc = "Enumeration of battery functions"]
1246pub enum MavBatteryFunction {
1247 #[doc = "Battery function is unknown"]
1248 MAV_BATTERY_FUNCTION_UNKNOWN = 0,
1249 #[doc = "Battery supports all flight systems"]
1250 MAV_BATTERY_FUNCTION_ALL = 1,
1251 #[doc = "Battery for the propulsion system"]
1252 MAV_BATTERY_FUNCTION_PROPULSION = 2,
1253 #[doc = "Avionics battery"]
1254 MAV_BATTERY_FUNCTION_AVIONICS = 3,
1255 #[doc = "Payload battery"]
1256 MAV_BATTERY_FUNCTION_PAYLOAD = 4,
1257}
1258impl MavBatteryFunction {
1259 pub const DEFAULT: Self = Self::MAV_BATTERY_FUNCTION_UNKNOWN;
1260}
1261impl Default for MavBatteryFunction {
1262 fn default() -> Self {
1263 Self::DEFAULT
1264 }
1265}
1266#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1267#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1268#[cfg_attr(feature = "serde", serde(tag = "type"))]
1269#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1270#[repr(u32)]
1271#[doc = "Battery mode. Note, the normal operation mode (i.e. when flying) should be reported as MAV_BATTERY_MODE_UNKNOWN to allow message trimming in normal flight."]
1272pub enum MavBatteryMode {
1273 #[doc = "Battery mode not supported/unknown battery mode/normal operation."]
1274 MAV_BATTERY_MODE_UNKNOWN = 0,
1275 #[doc = "Battery is auto discharging (towards storage level)."]
1276 MAV_BATTERY_MODE_AUTO_DISCHARGING = 1,
1277 #[doc = "Battery in hot-swap mode (current limited to prevent spikes that might damage sensitive electrical circuits)."]
1278 MAV_BATTERY_MODE_HOT_SWAP = 2,
1279}
1280impl MavBatteryMode {
1281 pub const DEFAULT: Self = Self::MAV_BATTERY_MODE_UNKNOWN;
1282}
1283impl Default for MavBatteryMode {
1284 fn default() -> Self {
1285 Self::DEFAULT
1286 }
1287}
1288#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1289#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1290#[cfg_attr(feature = "serde", serde(tag = "type"))]
1291#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1292#[repr(u32)]
1293#[doc = "Enumeration of battery types"]
1294pub enum MavBatteryType {
1295 #[doc = "Not specified."]
1296 MAV_BATTERY_TYPE_UNKNOWN = 0,
1297 #[doc = "Lithium polymer battery"]
1298 MAV_BATTERY_TYPE_LIPO = 1,
1299 #[doc = "Lithium-iron-phosphate battery"]
1300 MAV_BATTERY_TYPE_LIFE = 2,
1301 #[doc = "Lithium-ION battery"]
1302 MAV_BATTERY_TYPE_LION = 3,
1303 #[doc = "Nickel metal hydride battery"]
1304 MAV_BATTERY_TYPE_NIMH = 4,
1305}
1306impl MavBatteryType {
1307 pub const DEFAULT: Self = Self::MAV_BATTERY_TYPE_UNKNOWN;
1308}
1309impl Default for MavBatteryType {
1310 fn default() -> Self {
1311 Self::DEFAULT
1312 }
1313}
1314#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1315#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1316#[cfg_attr(feature = "serde", serde(tag = "type"))]
1317#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1318#[repr(u32)]
1319#[doc = "Commands to be executed by the MAV. They can be executed on user request, or as part of a mission script. If the action is used in a mission, the parameter mapping to the waypoint/mission message is as follows: Param 1, Param 2, Param 3, Param 4, X: Param 5, Y:Param 6, Z:Param 7. This command list is similar what ARINC 424 is for commercial aircraft: A data format how to interpret waypoint/mission data. NaN and INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current yaw or latitude rather than a specific value). See <https://mavlink.io/en/guide/xml_schema.html#MAV_CMD> for information about the structure of the MAV_CMD entries"]
1320pub enum MavCmd {
1321 #[doc = "Navigate to waypoint. This is intended for use in missions (for guided commands outside of missions use MAV_CMD_DO_REPOSITION)."]
1322 MAV_CMD_NAV_WAYPOINT = 16,
1323 #[doc = "Loiter around this waypoint an unlimited amount of time"]
1324 MAV_CMD_NAV_LOITER_UNLIM = 17,
1325 #[doc = "Loiter around this waypoint for X turns"]
1326 MAV_CMD_NAV_LOITER_TURNS = 18,
1327 #[doc = "Loiter at the specified latitude, longitude and altitude for a certain amount of time. Multicopter vehicles stop at the point (within a vehicle-specific acceptance radius). Forward-only moving vehicles (e.g. fixed-wing) circle the point with the specified radius/direction. If the Heading Required parameter (2) is non-zero forward moving aircraft will only leave the loiter circle once heading towards the next waypoint."]
1328 MAV_CMD_NAV_LOITER_TIME = 19,
1329 #[doc = "Return to launch location"]
1330 MAV_CMD_NAV_RETURN_TO_LAUNCH = 20,
1331 #[doc = "Land at location."]
1332 MAV_CMD_NAV_LAND = 21,
1333 #[doc = "Takeoff from ground / hand. Vehicles that support multiple takeoff modes (e.g. VTOL quadplane) should take off using the currently configured mode."]
1334 MAV_CMD_NAV_TAKEOFF = 22,
1335 #[doc = "Land at local position (local frame only)"]
1336 MAV_CMD_NAV_LAND_LOCAL = 23,
1337 #[doc = "Takeoff from local position (local frame only)"]
1338 MAV_CMD_NAV_TAKEOFF_LOCAL = 24,
1339 #[doc = "Vehicle following, i.e. this waypoint represents the position of a moving vehicle"]
1340 MAV_CMD_NAV_FOLLOW = 25,
1341 #[doc = "Continue on the current course and climb/descend to specified altitude. When the altitude is reached continue to the next command (i.e., don't proceed to the next command until the desired altitude is reached."]
1342 MAV_CMD_NAV_CONTINUE_AND_CHANGE_ALT = 30,
1343 #[doc = "Begin loiter at the specified Latitude and Longitude. If Lat=Lon=0, then loiter at the current position. Don't consider the navigation command complete (don't leave loiter) until the altitude has been reached. Additionally, if the Heading Required parameter is non-zero the aircraft will not leave the loiter until heading toward the next waypoint."]
1344 MAV_CMD_NAV_LOITER_TO_ALT = 31,
1345 #[doc = "Begin following a target"]
1346 MAV_CMD_DO_FOLLOW = 32,
1347 #[doc = "Reposition the MAV after a follow target command has been sent"]
1348 MAV_CMD_DO_FOLLOW_REPOSITION = 33,
1349 #[doc = "Start orbiting on the circumference of a circle defined by the parameters. Setting values to NaN/INT32_MAX (as appropriate) results in using defaults."]
1350 MAV_CMD_DO_ORBIT = 34,
1351 #[deprecated = " See `MAV_CMD_DO_SET_ROI_*` (Deprecated since 2018-01)"]
1352 #[doc = "Sets the region of interest (ROI) for a sensor set or the vehicle itself. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras."]
1353 MAV_CMD_NAV_ROI = 80,
1354 #[doc = "Control autonomous path planning on the MAV."]
1355 MAV_CMD_NAV_PATHPLANNING = 81,
1356 #[doc = "Navigate to waypoint using a spline path."]
1357 MAV_CMD_NAV_SPLINE_WAYPOINT = 82,
1358 #[doc = "Takeoff from ground using VTOL mode, and transition to forward flight with specified heading. The command should be ignored by vehicles that dont support both VTOL and fixed-wing flight (multicopters, boats,etc.)."]
1359 MAV_CMD_NAV_VTOL_TAKEOFF = 84,
1360 #[doc = "Land using VTOL mode"]
1361 MAV_CMD_NAV_VTOL_LAND = 85,
1362 #[doc = "hand control over to an external controller"]
1363 MAV_CMD_NAV_GUIDED_ENABLE = 92,
1364 #[doc = "Delay the next navigation command a number of seconds or until a specified time"]
1365 MAV_CMD_NAV_DELAY = 93,
1366 #[doc = "Descend and place payload. Vehicle moves to specified location, descends until it detects a hanging payload has reached the ground, and then releases the payload. If ground is not detected before the reaching the maximum descent value (param1), the command will complete without releasing the payload."]
1367 MAV_CMD_NAV_PAYLOAD_PLACE = 94,
1368 #[doc = "NOP - This command is only used to mark the upper limit of the NAV/ACTION commands in the enumeration"]
1369 MAV_CMD_NAV_LAST = 95,
1370 #[doc = "Delay mission state machine."]
1371 MAV_CMD_CONDITION_DELAY = 112,
1372 #[doc = "Ascend/descend to target altitude at specified rate. Delay mission state machine until desired altitude reached."]
1373 MAV_CMD_CONDITION_CHANGE_ALT = 113,
1374 #[doc = "Delay mission state machine until within desired distance of next NAV point."]
1375 MAV_CMD_CONDITION_DISTANCE = 114,
1376 #[doc = "Reach a certain target angle."]
1377 MAV_CMD_CONDITION_YAW = 115,
1378 #[doc = "NOP - This command is only used to mark the upper limit of the CONDITION commands in the enumeration"]
1379 MAV_CMD_CONDITION_LAST = 159,
1380 #[doc = "Set system mode."]
1381 MAV_CMD_DO_SET_MODE = 176,
1382 #[doc = "Jump to the desired command in the mission list. Repeat this action only the specified number of times"]
1383 MAV_CMD_DO_JUMP = 177,
1384 #[doc = "Change speed and/or throttle set points. The value persists until it is overridden or there is a mode change"]
1385 MAV_CMD_DO_CHANGE_SPEED = 178,
1386 #[doc = "Sets the home position to either to the current position or a specified position. The home position is the default position that the system will return to and land on. The position is set automatically by the system during the takeoff (and may also be set using this command). Note: the current home position may be emitted in a HOME_POSITION message on request (using MAV_CMD_REQUEST_MESSAGE with param1=242)."]
1387 MAV_CMD_DO_SET_HOME = 179,
1388 #[deprecated = " See `PARAM_SET` (Deprecated since 2024-04)"]
1389 #[doc = "Set a system parameter. Caution! Use of this command requires knowledge of the numeric enumeration value of the parameter."]
1390 MAV_CMD_DO_SET_PARAMETER = 180,
1391 #[doc = "Set a relay to a condition."]
1392 MAV_CMD_DO_SET_RELAY = 181,
1393 #[doc = "Cycle a relay on and off for a desired number of cycles with a desired period."]
1394 MAV_CMD_DO_REPEAT_RELAY = 182,
1395 #[doc = "Set a servo to a desired PWM value."]
1396 MAV_CMD_DO_SET_SERVO = 183,
1397 #[doc = "Cycle a between its nominal setting and a desired PWM for a desired number of cycles with a desired period."]
1398 MAV_CMD_DO_REPEAT_SERVO = 184,
1399 #[doc = "0.5); the ACK should be either MAV_RESULT_FAILED or MAV_RESULT_UNSUPPORTED."]
1400 MAV_CMD_DO_FLIGHTTERMINATION = 185,
1401 #[doc = "Change altitude set point."]
1402 MAV_CMD_DO_CHANGE_ALTITUDE = 186,
1403 #[doc = "Sets actuators (e.g. servos) to a desired value. The actuator numbers are mapped to specific outputs (e.g. on any MAIN or AUX PWM or UAVCAN) using a flight-stack specific mechanism (i.e. a parameter)."]
1404 MAV_CMD_DO_SET_ACTUATOR = 187,
1405 #[doc = "Mission item to specify the start of a failsafe/landing return-path segment (the end of the segment is the next MAV_CMD_DO_LAND_START item). A vehicle that is using missions for landing (e.g. in a return mode) will join the mission on the closest path of the return-path segment (instead of MAV_CMD_DO_LAND_START or the nearest waypoint). The main use case is to minimize the failsafe flight path in corridor missions, where the inbound/outbound paths are constrained (by geofences) to the same particular path. The MAV_CMD_NAV_RETURN_PATH_START would be placed at the start of the return path. If a failsafe occurs on the outbound path the vehicle will move to the nearest point on the return path (which is parallel for this kind of mission), effectively turning round and following the shortest path to landing. If a failsafe occurs on the inbound path the vehicle is already on the return segment and will continue to landing. The Latitude/Longitude/Altitude are optional, and may be set to 0 if not needed. If specified, the item defines the waypoint at which the return segment starts. If sent using as a command, the vehicle will perform a mission landing (using the land segment if defined) or reject the command if mission landings are not supported, or no mission landing is defined. When used as a command any position information in the command is ignored."]
1406 MAV_CMD_DO_RETURN_PATH_START = 188,
1407 #[doc = "Mission item to mark the start of a mission landing pattern, or a command to land with a mission landing pattern. When used in a mission, this is a marker for the start of a sequence of mission items that represent a landing pattern. It should be followed by a navigation item that defines the first waypoint of the landing sequence. The start marker positional params are used only for selecting what landing pattern to use if several are defined in the mission (the selected pattern will be the one with the marker position that is closest to the vehicle when a landing is commanded). If the marker item position has zero-values for latitude, longitude, and altitude, then landing pattern selection is instead based on the position of the first waypoint in the landing sequence. \t When sent as a command it triggers a landing using a mission landing pattern. \t The location parameters are not used in this case, and should be set to 0."]
1408 MAV_CMD_DO_LAND_START = 189,
1409 #[doc = "Mission command to perform a landing from a rally point."]
1410 MAV_CMD_DO_RALLY_LAND = 190,
1411 #[doc = "Mission command to safely abort an autonomous landing."]
1412 MAV_CMD_DO_GO_AROUND = 191,
1413 #[doc = "Reposition the vehicle to a specific WGS84 global position. This command is intended for guided commands (for missions use MAV_CMD_NAV_WAYPOINT instead)."]
1414 MAV_CMD_DO_REPOSITION = 192,
1415 #[doc = "If in a GPS controlled position mode, hold the current position or continue."]
1416 MAV_CMD_DO_PAUSE_CONTINUE = 193,
1417 #[doc = "Set moving direction to forward or reverse."]
1418 MAV_CMD_DO_SET_REVERSE = 194,
1419 #[doc = "Sets the region of interest (ROI) to a location. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal is not to react to this message."]
1420 MAV_CMD_DO_SET_ROI_LOCATION = 195,
1421 #[doc = "Sets the region of interest (ROI) to be toward next waypoint, with optional pitch/roll/yaw offset. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal device is not to react to this message."]
1422 MAV_CMD_DO_SET_ROI_WPNEXT_OFFSET = 196,
1423 #[doc = "Cancels any previous ROI command returning the vehicle/sensors to default flight characteristics. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal device is not to react to this message. After this command the gimbal manager should go back to manual input if available, and otherwise assume a neutral position."]
1424 MAV_CMD_DO_SET_ROI_NONE = 197,
1425 #[doc = "Mount tracks system with specified system ID. Determination of target vehicle position may be done with GLOBAL_POSITION_INT or any other means. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal device is not to react to this message."]
1426 MAV_CMD_DO_SET_ROI_SYSID = 198,
1427 #[doc = "Control onboard camera system."]
1428 MAV_CMD_DO_CONTROL_VIDEO = 200,
1429 #[deprecated = " See `MAV_CMD_DO_SET_ROI_*` (Deprecated since 2018-01)"]
1430 #[doc = "Sets the region of interest (ROI) for a sensor set or the vehicle itself. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras."]
1431 MAV_CMD_DO_SET_ROI = 201,
1432 #[doc = "Configure digital camera. This is a fallback message for systems that have not yet implemented PARAM_EXT_XXX messages and camera definition files (see <https://mavlink.io/en/services/camera_def.html> )."]
1433 MAV_CMD_DO_DIGICAM_CONFIGURE = 202,
1434 #[doc = "Control digital camera. This is a fallback message for systems that have not yet implemented PARAM_EXT_XXX messages and camera definition files (see <https://mavlink.io/en/services/camera_def.html> )."]
1435 MAV_CMD_DO_DIGICAM_CONTROL = 203,
1436 #[deprecated = "This message has been superseded by MAV_CMD_DO_GIMBAL_MANAGER_CONFIGURE. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_CONFIGURE` (Deprecated since 2020-01)"]
1437 #[doc = "Mission command to configure a camera or antenna mount"]
1438 MAV_CMD_DO_MOUNT_CONFIGURE = 204,
1439 #[deprecated = "This message is ambiguous and inconsistent. It has been superseded by MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW and `MAV_CMD_DO_SET_ROI_*` variants. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
1440 #[doc = "Mission command to control a camera or antenna mount"]
1441 MAV_CMD_DO_MOUNT_CONTROL = 205,
1442 #[doc = "Mission command to set camera trigger distance for this flight. The camera is triggered each time this distance is exceeded. This command can also be used to set the shutter integration time for the camera."]
1443 MAV_CMD_DO_SET_CAM_TRIGG_DIST = 206,
1444 #[doc = "Enable the geofence. This can be used in a mission or via the command protocol. The persistence/lifetime of the setting is undefined. Depending on flight stack implementation it may persist until superseded, or it may revert to a system default at the end of a mission. Flight stacks typically reset the setting to system defaults on reboot."]
1445 MAV_CMD_DO_FENCE_ENABLE = 207,
1446 #[doc = "Mission item/command to release a parachute or enable/disable auto release."]
1447 MAV_CMD_DO_PARACHUTE = 208,
1448 #[doc = "Command to perform motor test."]
1449 MAV_CMD_DO_MOTOR_TEST = 209,
1450 #[doc = "Change to/from inverted flight."]
1451 MAV_CMD_DO_INVERTED_FLIGHT = 210,
1452 #[doc = "Mission command to operate a gripper."]
1453 MAV_CMD_DO_GRIPPER = 211,
1454 #[doc = "Enable/disable autotune."]
1455 MAV_CMD_DO_AUTOTUNE_ENABLE = 212,
1456 #[doc = "Sets a desired vehicle turn angle and speed change."]
1457 MAV_CMD_NAV_SET_YAW_SPEED = 213,
1458 #[doc = "Mission command to set camera trigger interval for this flight. If triggering is enabled, the camera is triggered each time this interval expires. This command can also be used to set the shutter integration time for the camera."]
1459 MAV_CMD_DO_SET_CAM_TRIGG_INTERVAL = 214,
1460 #[deprecated = " See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
1461 #[doc = "Mission command to control a camera or antenna mount, using a quaternion as reference."]
1462 MAV_CMD_DO_MOUNT_CONTROL_QUAT = 220,
1463 #[doc = "set id of master controller"]
1464 MAV_CMD_DO_GUIDED_MASTER = 221,
1465 #[doc = "Set limits for external control"]
1466 MAV_CMD_DO_GUIDED_LIMITS = 222,
1467 #[doc = "Control vehicle engine. This is interpreted by the vehicles engine controller to change the target engine state. It is intended for vehicles with internal combustion engines"]
1468 MAV_CMD_DO_ENGINE_CONTROL = 223,
1469 #[doc = "Set the mission item with sequence number seq as the current item and emit MISSION_CURRENT (whether or not the mission number changed). If a mission is currently being executed, the system will continue to this new mission item on the shortest path, skipping any intermediate mission items. \t Note that mission jump repeat counters are not reset unless param2 is set (see MAV_CMD_DO_JUMP param2). This command may trigger a mission state-machine change on some systems: for example from MISSION_STATE_NOT_STARTED or MISSION_STATE_PAUSED to MISSION_STATE_ACTIVE. If the system is in mission mode, on those systems this command might therefore start, restart or resume the mission. If the system is not in mission mode this command must not trigger a switch to mission mode. The mission may be \"reset\" using param2. Resetting sets jump counters to initial values (to reset counters without changing the current mission item set the param1 to `-1`). Resetting also explicitly changes a mission state of MISSION_STATE_COMPLETE to MISSION_STATE_PAUSED or MISSION_STATE_ACTIVE, potentially allowing it to resume when it is (next) in a mission mode. \t The command will ACK with MAV_RESULT_FAILED if the sequence number is out of range (including if there is no mission item)."]
1470 MAV_CMD_DO_SET_MISSION_CURRENT = 224,
1471 #[doc = "NOP - This command is only used to mark the upper limit of the DO commands in the enumeration"]
1472 MAV_CMD_DO_LAST = 240,
1473 #[doc = "Trigger calibration. This command will be only accepted if in pre-flight mode. Except for Temperature Calibration, only one sensor should be set in a single message and all others should be zero."]
1474 MAV_CMD_PREFLIGHT_CALIBRATION = 241,
1475 #[doc = "Set sensor offsets. This command will be only accepted if in pre-flight mode."]
1476 MAV_CMD_PREFLIGHT_SET_SENSOR_OFFSETS = 242,
1477 #[doc = "Trigger UAVCAN configuration (actuator ID assignment and direction mapping). Note that this maps to the legacy UAVCAN v0 function UAVCAN_ENUMERATE, which is intended to be executed just once during initial vehicle configuration (it is not a normal pre-flight command and has been poorly named)."]
1478 MAV_CMD_PREFLIGHT_UAVCAN = 243,
1479 #[doc = "Request storage of different parameter values and logs. This command will be only accepted if in pre-flight mode."]
1480 MAV_CMD_PREFLIGHT_STORAGE = 245,
1481 #[doc = "Request the reboot or shutdown of system components."]
1482 MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN = 246,
1483 #[doc = "Override current mission with command to pause mission, pause mission and move to position, continue/resume mission. When param 1 indicates that the mission is paused (MAV_GOTO_DO_HOLD), param 2 defines whether it holds in place or moves to another position."]
1484 MAV_CMD_OVERRIDE_GOTO = 252,
1485 #[doc = "Mission command to set a Camera Auto Mount Pivoting Oblique Survey (Replaces CAM_TRIGG_DIST for this purpose). The camera is triggered each time this distance is exceeded, then the mount moves to the next position. Params 4~6 set-up the angle limits and number of positions for oblique survey, where mount-enabled vehicles automatically roll the camera between shots to emulate an oblique camera setup (providing an increased HFOV). This command can also be used to set the shutter integration time for the camera."]
1486 MAV_CMD_OBLIQUE_SURVEY = 260,
1487 #[doc = "Enable the specified standard MAVLink mode. If the specified mode is not supported, the vehicle should ACK with MAV_RESULT_FAILED. See <https://mavlink.io/en/services/standard_modes.html>"]
1488 MAV_CMD_DO_SET_STANDARD_MODE = 262,
1489 #[doc = "start running a mission"]
1490 MAV_CMD_MISSION_START = 300,
1491 #[doc = "Actuator testing command. This is similar to MAV_CMD_DO_MOTOR_TEST but operates on the level of output functions, i.e. it is possible to test Motor1 independent from which output it is configured on. Autopilots must NACK this command with MAV_RESULT_TEMPORARILY_REJECTED while armed."]
1492 MAV_CMD_ACTUATOR_TEST = 310,
1493 #[doc = "Actuator configuration command."]
1494 MAV_CMD_CONFIGURE_ACTUATOR = 311,
1495 #[doc = "Arms / Disarms a component"]
1496 MAV_CMD_COMPONENT_ARM_DISARM = 400,
1497 #[doc = "Instructs a target system to run pre-arm checks. This allows preflight checks to be run on demand, which may be useful on systems that normally run them at low rate, or which do not trigger checks when the armable state might have changed. This command should return MAV_RESULT_ACCEPTED if it will run the checks. The results of the checks are usually then reported in SYS_STATUS messages (this is system-specific). The command should return MAV_RESULT_TEMPORARILY_REJECTED if the system is already armed."]
1498 MAV_CMD_RUN_PREARM_CHECKS = 401,
1499 #[doc = "Turns illuminators ON/OFF. An illuminator is a light source that is used for lighting up dark areas external to the system: e.g. a torch or searchlight (as opposed to a light source for illuminating the system itself, e.g. an indicator light)."]
1500 MAV_CMD_ILLUMINATOR_ON_OFF = 405,
1501 #[doc = "Configures illuminator settings. An illuminator is a light source that is used for lighting up dark areas external to the system: e.g. a torch or searchlight (as opposed to a light source for illuminating the system itself, e.g. an indicator light)."]
1502 MAV_CMD_DO_ILLUMINATOR_CONFIGURE = 406,
1503 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2022-04)"]
1504 #[doc = "Request the home position from the vehicle. \t The vehicle will ACK the command and then emit the HOME_POSITION message."]
1505 MAV_CMD_GET_HOME_POSITION = 410,
1506 #[doc = "Inject artificial failure for testing purposes. Note that autopilots should implement an additional protection before accepting this command such as a specific param setting."]
1507 MAV_CMD_INJECT_FAILURE = 420,
1508 #[doc = "Starts receiver pairing."]
1509 MAV_CMD_START_RX_PAIR = 500,
1510 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2022-04)"]
1511 #[doc = "Request the interval between messages for a particular MAVLink message ID. The receiver should ACK the command and then emit its response in a MESSAGE_INTERVAL message."]
1512 MAV_CMD_GET_MESSAGE_INTERVAL = 510,
1513 #[doc = "Set the interval between messages for a particular MAVLink message ID. This interface replaces REQUEST_DATA_STREAM."]
1514 MAV_CMD_SET_MESSAGE_INTERVAL = 511,
1515 #[doc = "Request the target system(s) emit a single instance of a specified message (i.e. a \"one-shot\" version of MAV_CMD_SET_MESSAGE_INTERVAL)."]
1516 MAV_CMD_REQUEST_MESSAGE = 512,
1517 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1518 #[doc = "Request MAVLink protocol version compatibility. All receivers should ACK the command and then emit their capabilities in an PROTOCOL_VERSION message"]
1519 MAV_CMD_REQUEST_PROTOCOL_VERSION = 519,
1520 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1521 #[doc = "Request autopilot capabilities. The receiver should ACK the command and then emit its capabilities in an AUTOPILOT_VERSION message"]
1522 MAV_CMD_REQUEST_AUTOPILOT_CAPABILITIES = 520,
1523 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1524 #[doc = "Request camera information (CAMERA_INFORMATION)."]
1525 MAV_CMD_REQUEST_CAMERA_INFORMATION = 521,
1526 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1527 #[doc = "Request camera settings (CAMERA_SETTINGS)."]
1528 MAV_CMD_REQUEST_CAMERA_SETTINGS = 522,
1529 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1530 #[doc = "Request storage information (STORAGE_INFORMATION). Use the command's target_component to target a specific component's storage."]
1531 MAV_CMD_REQUEST_STORAGE_INFORMATION = 525,
1532 #[doc = "Format a storage medium. Once format is complete, a STORAGE_INFORMATION message is sent. Use the command's target_component to target a specific component's storage."]
1533 MAV_CMD_STORAGE_FORMAT = 526,
1534 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1535 #[doc = "Request camera capture status (CAMERA_CAPTURE_STATUS)"]
1536 MAV_CMD_REQUEST_CAMERA_CAPTURE_STATUS = 527,
1537 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1538 #[doc = "Request flight information (FLIGHT_INFORMATION)"]
1539 MAV_CMD_REQUEST_FLIGHT_INFORMATION = 528,
1540 #[doc = "Reset all camera settings to Factory Default"]
1541 MAV_CMD_RESET_CAMERA_SETTINGS = 529,
1542 #[doc = "Set camera running mode. Use NaN for reserved values. GCS will send a MAV_CMD_REQUEST_VIDEO_STREAM_STATUS command after a mode change if the camera supports video streaming."]
1543 MAV_CMD_SET_CAMERA_MODE = 530,
1544 #[doc = "Set camera zoom. Camera must respond with a CAMERA_SETTINGS message (on success)."]
1545 MAV_CMD_SET_CAMERA_ZOOM = 531,
1546 #[doc = "Set camera focus. Camera must respond with a CAMERA_SETTINGS message (on success)."]
1547 MAV_CMD_SET_CAMERA_FOCUS = 532,
1548 #[doc = "Set that a particular storage is the preferred location for saving photos, videos, and/or other media (e.g. to set that an SD card is used for storing videos). There can only be one preferred save location for each particular media type: setting a media usage flag will clear/reset that same flag if set on any other storage. If no flag is set the system should use its default storage. A target system can choose to always use default storage, in which case it should ACK the command with MAV_RESULT_UNSUPPORTED. A target system can choose to not allow a particular storage to be set as preferred storage, in which case it should ACK the command with MAV_RESULT_DENIED."]
1549 MAV_CMD_SET_STORAGE_USAGE = 533,
1550 #[doc = "Set camera source. Changes the camera's active sources on cameras with multiple image sensors."]
1551 MAV_CMD_SET_CAMERA_SOURCE = 534,
1552 #[doc = "Tagged jump target. Can be jumped to with MAV_CMD_DO_JUMP_TAG."]
1553 MAV_CMD_JUMP_TAG = 600,
1554 #[doc = "Jump to the matching tag in the mission list. Repeat this action for the specified number of times. A mission should contain a single matching tag for each jump. If this is not the case then a jump to a missing tag should complete the mission, and a jump where there are multiple matching tags should always select the one with the lowest mission sequence number."]
1555 MAV_CMD_DO_JUMP_TAG = 601,
1556 #[doc = "Set gimbal manager pitch/yaw setpoints (low rate command). It is possible to set combinations of the values below. E.g. an angle as well as a desired angular rate can be used to get to this angle at a certain angular rate, or an angular rate only will result in continuous turning. NaN is to be used to signal unset. Note: only the gimbal manager will react to this command - it will be ignored by a gimbal device. Use GIMBAL_MANAGER_SET_PITCHYAW if you need to stream pitch/yaw setpoints at higher rate."]
1557 MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW = 1000,
1558 #[doc = "Gimbal configuration to set which sysid/compid is in primary and secondary control."]
1559 MAV_CMD_DO_GIMBAL_MANAGER_CONFIGURE = 1001,
1560 #[doc = "Start image capture sequence. CAMERA_IMAGE_CAPTURED must be emitted after each capture. Param1 (id) may be used to specify the target camera: 0: all cameras, 1 to 6: autopilot-connected cameras, 7-255: MAVLink camera component ID. It is needed in order to target specific cameras connected to the autopilot, or specific sensors in a multi-sensor camera (neither of which have a distinct MAVLink component ID). It is also needed to specify the target camera in missions. When used in a mission, an autopilot should execute the MAV_CMD for a specified local camera (param1 = 1-6), or resend it as a command if it is intended for a MAVLink camera (param1 = 7 - 255), setting the command's target_component as the param1 value (and setting param1 in the command to zero). If the param1 is 0 the autopilot should do both. When sent in a command the target MAVLink address is set using target_component. If addressed specifically to an autopilot: param1 should be used in the same way as it is for missions (though command should NACK with MAV_RESULT_DENIED if a specified local camera does not exist). If addressed to a MAVLink camera, param 1 can be used to address all cameras (0), or to separately address 1 to 7 individual sensors. Other values should be NACKed with MAV_RESULT_DENIED. If the command is broadcast (target_component is 0) then param 1 should be set to 0 (any other value should be NACKED with MAV_RESULT_DENIED). An autopilot would trigger any local cameras and forward the command to all channels."]
1561 MAV_CMD_IMAGE_START_CAPTURE = 2000,
1562 #[doc = "Stop image capture sequence. Param1 (id) may be used to specify the target camera: 0: all cameras, 1 to 6: autopilot-connected cameras, 7-255: MAVLink camera component ID. It is needed in order to target specific cameras connected to the autopilot, or specific sensors in a multi-sensor camera (neither of which have a distinct MAVLink component ID). It is also needed to specify the target camera in missions. When used in a mission, an autopilot should execute the MAV_CMD for a specified local camera (param1 = 1-6), or resend it as a command if it is intended for a MAVLink camera (param1 = 7 - 255), setting the command's target_component as the param1 value (and setting param1 in the command to zero). If the param1 is 0 the autopilot should do both. When sent in a command the target MAVLink address is set using target_component. If addressed specifically to an autopilot: param1 should be used in the same way as it is for missions (though command should NACK with MAV_RESULT_DENIED if a specified local camera does not exist). If addressed to a MAVLink camera, param1 can be used to address all cameras (0), or to separately address 1 to 7 individual sensors. Other values should be NACKed with MAV_RESULT_DENIED. If the command is broadcast (target_component is 0) then param 1 should be set to 0 (any other value should be NACKED with MAV_RESULT_DENIED). An autopilot would trigger any local cameras and forward the command to all channels."]
1563 MAV_CMD_IMAGE_STOP_CAPTURE = 2001,
1564 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1565 #[doc = "Re-request a CAMERA_IMAGE_CAPTURED message."]
1566 MAV_CMD_REQUEST_CAMERA_IMAGE_CAPTURE = 2002,
1567 #[doc = "Enable or disable on-board camera triggering system."]
1568 MAV_CMD_DO_TRIGGER_CONTROL = 2003,
1569 #[doc = "If the camera supports point visual tracking (CAMERA_CAP_FLAGS_HAS_TRACKING_POINT is set), this command allows to initiate the tracking."]
1570 MAV_CMD_CAMERA_TRACK_POINT = 2004,
1571 #[doc = "If the camera supports rectangle visual tracking (CAMERA_CAP_FLAGS_HAS_TRACKING_RECTANGLE is set), this command allows to initiate the tracking."]
1572 MAV_CMD_CAMERA_TRACK_RECTANGLE = 2005,
1573 #[doc = "Stops ongoing tracking."]
1574 MAV_CMD_CAMERA_STOP_TRACKING = 2010,
1575 #[doc = "Starts video capture (recording)."]
1576 MAV_CMD_VIDEO_START_CAPTURE = 2500,
1577 #[doc = "Stop the current video capture (recording)."]
1578 MAV_CMD_VIDEO_STOP_CAPTURE = 2501,
1579 #[doc = "Start video streaming"]
1580 MAV_CMD_VIDEO_START_STREAMING = 2502,
1581 #[doc = "Stop the given video stream"]
1582 MAV_CMD_VIDEO_STOP_STREAMING = 2503,
1583 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1584 #[doc = "Request video stream information (VIDEO_STREAM_INFORMATION)"]
1585 MAV_CMD_REQUEST_VIDEO_STREAM_INFORMATION = 2504,
1586 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1587 #[doc = "Request video stream status (VIDEO_STREAM_STATUS)"]
1588 MAV_CMD_REQUEST_VIDEO_STREAM_STATUS = 2505,
1589 #[doc = "Request to start streaming logging data over MAVLink (see also LOGGING_DATA message)"]
1590 MAV_CMD_LOGGING_START = 2510,
1591 #[doc = "Request to stop streaming log data over MAVLink"]
1592 MAV_CMD_LOGGING_STOP = 2511,
1593 MAV_CMD_AIRFRAME_CONFIGURATION = 2520,
1594 #[doc = "Request to start/stop transmitting over the high latency telemetry"]
1595 MAV_CMD_CONTROL_HIGH_LATENCY = 2600,
1596 #[doc = "Create a panorama at the current position"]
1597 MAV_CMD_PANORAMA_CREATE = 2800,
1598 #[doc = "Request VTOL transition"]
1599 MAV_CMD_DO_VTOL_TRANSITION = 3000,
1600 #[doc = "Request authorization to arm the vehicle to a external entity, the arm authorizer is responsible to request all data that is needs from the vehicle before authorize or deny the request. \t\tIf approved the COMMAND_ACK message progress field should be set with period of time that this authorization is valid in seconds. \t\tIf the authorization is denied COMMAND_ACK.result_param2 should be set with one of the reasons in ARM_AUTH_DENIED_REASON."]
1601 MAV_CMD_ARM_AUTHORIZATION_REQUEST = 3001,
1602 #[doc = "This command sets the submode to standard guided when vehicle is in guided mode. The vehicle holds position and altitude and the user can input the desired velocities along all three axes."]
1603 MAV_CMD_SET_GUIDED_SUBMODE_STANDARD = 4000,
1604 #[doc = "This command sets submode circle when vehicle is in guided mode. Vehicle flies along a circle facing the center of the circle. The user can input the velocity along the circle and change the radius. If no input is given the vehicle will hold position."]
1605 MAV_CMD_SET_GUIDED_SUBMODE_CIRCLE = 4001,
1606 #[doc = "Delay mission state machine until gate has been reached."]
1607 MAV_CMD_CONDITION_GATE = 4501,
1608 #[doc = "Fence return point (there can only be one such point in a geofence definition). If rally points are supported they should be used instead."]
1609 MAV_CMD_NAV_FENCE_RETURN_POINT = 5000,
1610 #[doc = "Fence vertex for an inclusion polygon (the polygon must not be self-intersecting). The vehicle must stay within this area. Minimum of 3 vertices required. The vertices for a polygon must be sent sequentially, each with param1 set to the total number of vertices in the polygon."]
1611 MAV_CMD_NAV_FENCE_POLYGON_VERTEX_INCLUSION = 5001,
1612 #[doc = "Fence vertex for an exclusion polygon (the polygon must not be self-intersecting). The vehicle must stay outside this area. Minimum of 3 vertices required. The vertices for a polygon must be sent sequentially, each with param1 set to the total number of vertices in the polygon."]
1613 MAV_CMD_NAV_FENCE_POLYGON_VERTEX_EXCLUSION = 5002,
1614 #[doc = "Circular fence area. The vehicle must stay inside this area."]
1615 MAV_CMD_NAV_FENCE_CIRCLE_INCLUSION = 5003,
1616 #[doc = "Circular fence area. The vehicle must stay outside this area."]
1617 MAV_CMD_NAV_FENCE_CIRCLE_EXCLUSION = 5004,
1618 #[doc = "Rally point. You can have multiple rally points defined."]
1619 MAV_CMD_NAV_RALLY_POINT = 5100,
1620 #[doc = "Commands the vehicle to respond with a sequence of messages UAVCAN_NODE_INFO, one message per every UAVCAN node that is online. Note that some of the response messages can be lost, which the receiver can detect easily by checking whether every received UAVCAN_NODE_STATUS has a matching message UAVCAN_NODE_INFO received earlier; if not, this command should be sent again in order to request re-transmission of the node information messages."]
1621 MAV_CMD_UAVCAN_GET_NODE_INFO = 5200,
1622 #[doc = "Change state of safety switch."]
1623 MAV_CMD_DO_SET_SAFETY_SWITCH_STATE = 5300,
1624 #[doc = "Trigger the start of an ADSB-out IDENT. This should only be used when requested to do so by an Air Traffic Controller in controlled airspace. This starts the IDENT which is then typically held for 18 seconds by the hardware per the Mode A, C, and S transponder spec."]
1625 MAV_CMD_DO_ADSB_OUT_IDENT = 10001,
1626 #[deprecated = " (Deprecated since 2021-06)"]
1627 #[doc = "Deploy payload on a Lat / Lon / Alt position. This includes the navigation to reach the required release position and velocity."]
1628 MAV_CMD_PAYLOAD_PREPARE_DEPLOY = 30001,
1629 #[deprecated = " (Deprecated since 2021-06)"]
1630 #[doc = "Control the payload deployment."]
1631 MAV_CMD_PAYLOAD_CONTROL_DEPLOY = 30002,
1632 #[doc = "Magnetometer calibration based on provided known yaw. This allows for fast calibration using WMM field tables in the vehicle, given only the known yaw of the vehicle. If Latitude and longitude are both zero then use the current vehicle location."]
1633 MAV_CMD_FIXED_MAG_CAL_YAW = 42006,
1634 #[doc = "Command to operate winch."]
1635 MAV_CMD_DO_WINCH = 42600,
1636 #[doc = "Provide an external position estimate for use when dead-reckoning. This is meant to be used for occasional position resets that may be provided by a external system such as a remote pilot using landmarks over a video link."]
1637 MAV_CMD_EXTERNAL_POSITION_ESTIMATE = 43003,
1638 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1639 MAV_CMD_WAYPOINT_USER_1 = 31000,
1640 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1641 MAV_CMD_WAYPOINT_USER_2 = 31001,
1642 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1643 MAV_CMD_WAYPOINT_USER_3 = 31002,
1644 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1645 MAV_CMD_WAYPOINT_USER_4 = 31003,
1646 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1647 MAV_CMD_WAYPOINT_USER_5 = 31004,
1648 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1649 MAV_CMD_SPATIAL_USER_1 = 31005,
1650 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1651 MAV_CMD_SPATIAL_USER_2 = 31006,
1652 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1653 MAV_CMD_SPATIAL_USER_3 = 31007,
1654 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1655 MAV_CMD_SPATIAL_USER_4 = 31008,
1656 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1657 MAV_CMD_SPATIAL_USER_5 = 31009,
1658 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1659 MAV_CMD_USER_1 = 31010,
1660 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1661 MAV_CMD_USER_2 = 31011,
1662 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1663 MAV_CMD_USER_3 = 31012,
1664 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1665 MAV_CMD_USER_4 = 31013,
1666 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1667 MAV_CMD_USER_5 = 31014,
1668 #[doc = "Request forwarding of CAN packets from the given CAN bus to this component. CAN Frames are sent using CAN_FRAME and CANFD_FRAME messages"]
1669 MAV_CMD_CAN_FORWARD = 32000,
1670}
1671impl MavCmd {
1672 pub const DEFAULT: Self = Self::MAV_CMD_NAV_WAYPOINT;
1673}
1674impl Default for MavCmd {
1675 fn default() -> Self {
1676 Self::DEFAULT
1677 }
1678}
1679#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1680#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1681#[cfg_attr(feature = "serde", serde(tag = "type"))]
1682#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1683#[repr(u32)]
1684#[doc = "Possible actions an aircraft can take to avoid a collision."]
1685pub enum MavCollisionAction {
1686 #[doc = "Ignore any potential collisions"]
1687 MAV_COLLISION_ACTION_NONE = 0,
1688 #[doc = "Report potential collision"]
1689 MAV_COLLISION_ACTION_REPORT = 1,
1690 #[doc = "Ascend or Descend to avoid threat"]
1691 MAV_COLLISION_ACTION_ASCEND_OR_DESCEND = 2,
1692 #[doc = "Move horizontally to avoid threat"]
1693 MAV_COLLISION_ACTION_MOVE_HORIZONTALLY = 3,
1694 #[doc = "Aircraft to move perpendicular to the collision's velocity vector"]
1695 MAV_COLLISION_ACTION_MOVE_PERPENDICULAR = 4,
1696 #[doc = "Aircraft to fly directly back to its launch point"]
1697 MAV_COLLISION_ACTION_RTL = 5,
1698 #[doc = "Aircraft to stop in place"]
1699 MAV_COLLISION_ACTION_HOVER = 6,
1700}
1701impl MavCollisionAction {
1702 pub const DEFAULT: Self = Self::MAV_COLLISION_ACTION_NONE;
1703}
1704impl Default for MavCollisionAction {
1705 fn default() -> Self {
1706 Self::DEFAULT
1707 }
1708}
1709#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1710#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1711#[cfg_attr(feature = "serde", serde(tag = "type"))]
1712#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1713#[repr(u32)]
1714#[doc = "Source of information about this collision."]
1715pub enum MavCollisionSrc {
1716 #[doc = "ID field references ADSB_VEHICLE packets"]
1717 MAV_COLLISION_SRC_ADSB = 0,
1718 #[doc = "ID field references MAVLink SRC ID"]
1719 MAV_COLLISION_SRC_MAVLINK_GPS_GLOBAL_INT = 1,
1720}
1721impl MavCollisionSrc {
1722 pub const DEFAULT: Self = Self::MAV_COLLISION_SRC_ADSB;
1723}
1724impl Default for MavCollisionSrc {
1725 fn default() -> Self {
1726 Self::DEFAULT
1727 }
1728}
1729#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1730#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1731#[cfg_attr(feature = "serde", serde(tag = "type"))]
1732#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1733#[repr(u32)]
1734#[doc = "Aircraft-rated danger from this threat."]
1735pub enum MavCollisionThreatLevel {
1736 #[doc = "Not a threat"]
1737 MAV_COLLISION_THREAT_LEVEL_NONE = 0,
1738 #[doc = "Craft is mildly concerned about this threat"]
1739 MAV_COLLISION_THREAT_LEVEL_LOW = 1,
1740 #[doc = "Craft is panicking, and may take actions to avoid threat"]
1741 MAV_COLLISION_THREAT_LEVEL_HIGH = 2,
1742}
1743impl MavCollisionThreatLevel {
1744 pub const DEFAULT: Self = Self::MAV_COLLISION_THREAT_LEVEL_NONE;
1745}
1746impl Default for MavCollisionThreatLevel {
1747 fn default() -> Self {
1748 Self::DEFAULT
1749 }
1750}
1751#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1752#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1753#[cfg_attr(feature = "serde", serde(tag = "type"))]
1754#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1755#[repr(u32)]
1756#[doc = "Component ids (values) for the different types and instances of onboard hardware/software that might make up a MAVLink system (autopilot, cameras, servos, GPS systems, avoidance systems etc.). Components must use the appropriate ID in their source address when sending messages. Components can also use IDs to determine if they are the intended recipient of an incoming message. The MAV_COMP_ID_ALL value is used to indicate messages that must be processed by all components. When creating new entries, components that can have multiple instances (e.g. cameras, servos etc.) should be allocated sequential values. An appropriate number of values should be left free after these components to allow the number of instances to be expanded."]
1757pub enum MavComponent {
1758 #[doc = "Target id (target_component) used to broadcast messages to all components of the receiving system. Components should attempt to process messages with this component ID and forward to components on any other interfaces. Note: This is not a valid *source* component id for a message."]
1759 MAV_COMP_ID_ALL = 0,
1760 #[doc = "System flight controller component (\"autopilot\"). Only one autopilot is expected in a particular system."]
1761 MAV_COMP_ID_AUTOPILOT1 = 1,
1762 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1763 MAV_COMP_ID_USER1 = 25,
1764 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1765 MAV_COMP_ID_USER2 = 26,
1766 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1767 MAV_COMP_ID_USER3 = 27,
1768 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1769 MAV_COMP_ID_USER4 = 28,
1770 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1771 MAV_COMP_ID_USER5 = 29,
1772 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1773 MAV_COMP_ID_USER6 = 30,
1774 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1775 MAV_COMP_ID_USER7 = 31,
1776 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1777 MAV_COMP_ID_USER8 = 32,
1778 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1779 MAV_COMP_ID_USER9 = 33,
1780 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1781 MAV_COMP_ID_USER10 = 34,
1782 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1783 MAV_COMP_ID_USER11 = 35,
1784 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1785 MAV_COMP_ID_USER12 = 36,
1786 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1787 MAV_COMP_ID_USER13 = 37,
1788 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1789 MAV_COMP_ID_USER14 = 38,
1790 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1791 MAV_COMP_ID_USER15 = 39,
1792 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1793 MAV_COMP_ID_USER16 = 40,
1794 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1795 MAV_COMP_ID_USER17 = 41,
1796 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1797 MAV_COMP_ID_USER18 = 42,
1798 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1799 MAV_COMP_ID_USER19 = 43,
1800 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1801 MAV_COMP_ID_USER20 = 44,
1802 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1803 MAV_COMP_ID_USER21 = 45,
1804 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1805 MAV_COMP_ID_USER22 = 46,
1806 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1807 MAV_COMP_ID_USER23 = 47,
1808 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1809 MAV_COMP_ID_USER24 = 48,
1810 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1811 MAV_COMP_ID_USER25 = 49,
1812 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1813 MAV_COMP_ID_USER26 = 50,
1814 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1815 MAV_COMP_ID_USER27 = 51,
1816 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1817 MAV_COMP_ID_USER28 = 52,
1818 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1819 MAV_COMP_ID_USER29 = 53,
1820 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1821 MAV_COMP_ID_USER30 = 54,
1822 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1823 MAV_COMP_ID_USER31 = 55,
1824 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1825 MAV_COMP_ID_USER32 = 56,
1826 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1827 MAV_COMP_ID_USER33 = 57,
1828 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1829 MAV_COMP_ID_USER34 = 58,
1830 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1831 MAV_COMP_ID_USER35 = 59,
1832 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1833 MAV_COMP_ID_USER36 = 60,
1834 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1835 MAV_COMP_ID_USER37 = 61,
1836 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1837 MAV_COMP_ID_USER38 = 62,
1838 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1839 MAV_COMP_ID_USER39 = 63,
1840 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1841 MAV_COMP_ID_USER40 = 64,
1842 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1843 MAV_COMP_ID_USER41 = 65,
1844 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1845 MAV_COMP_ID_USER42 = 66,
1846 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1847 MAV_COMP_ID_USER43 = 67,
1848 #[doc = "Telemetry radio (e.g. SiK radio, or other component that emits RADIO_STATUS messages)."]
1849 MAV_COMP_ID_TELEMETRY_RADIO = 68,
1850 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1851 MAV_COMP_ID_USER45 = 69,
1852 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1853 MAV_COMP_ID_USER46 = 70,
1854 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1855 MAV_COMP_ID_USER47 = 71,
1856 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1857 MAV_COMP_ID_USER48 = 72,
1858 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1859 MAV_COMP_ID_USER49 = 73,
1860 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1861 MAV_COMP_ID_USER50 = 74,
1862 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1863 MAV_COMP_ID_USER51 = 75,
1864 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1865 MAV_COMP_ID_USER52 = 76,
1866 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1867 MAV_COMP_ID_USER53 = 77,
1868 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1869 MAV_COMP_ID_USER54 = 78,
1870 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1871 MAV_COMP_ID_USER55 = 79,
1872 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1873 MAV_COMP_ID_USER56 = 80,
1874 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1875 MAV_COMP_ID_USER57 = 81,
1876 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1877 MAV_COMP_ID_USER58 = 82,
1878 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1879 MAV_COMP_ID_USER59 = 83,
1880 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1881 MAV_COMP_ID_USER60 = 84,
1882 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1883 MAV_COMP_ID_USER61 = 85,
1884 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1885 MAV_COMP_ID_USER62 = 86,
1886 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1887 MAV_COMP_ID_USER63 = 87,
1888 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1889 MAV_COMP_ID_USER64 = 88,
1890 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1891 MAV_COMP_ID_USER65 = 89,
1892 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1893 MAV_COMP_ID_USER66 = 90,
1894 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1895 MAV_COMP_ID_USER67 = 91,
1896 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1897 MAV_COMP_ID_USER68 = 92,
1898 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1899 MAV_COMP_ID_USER69 = 93,
1900 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1901 MAV_COMP_ID_USER70 = 94,
1902 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1903 MAV_COMP_ID_USER71 = 95,
1904 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1905 MAV_COMP_ID_USER72 = 96,
1906 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1907 MAV_COMP_ID_USER73 = 97,
1908 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1909 MAV_COMP_ID_USER74 = 98,
1910 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1911 MAV_COMP_ID_USER75 = 99,
1912 #[doc = "Camera #1."]
1913 MAV_COMP_ID_CAMERA = 100,
1914 #[doc = "Camera #2."]
1915 MAV_COMP_ID_CAMERA2 = 101,
1916 #[doc = "Camera #3."]
1917 MAV_COMP_ID_CAMERA3 = 102,
1918 #[doc = "Camera #4."]
1919 MAV_COMP_ID_CAMERA4 = 103,
1920 #[doc = "Camera #5."]
1921 MAV_COMP_ID_CAMERA5 = 104,
1922 #[doc = "Camera #6."]
1923 MAV_COMP_ID_CAMERA6 = 105,
1924 #[doc = "Servo #1."]
1925 MAV_COMP_ID_SERVO1 = 140,
1926 #[doc = "Servo #2."]
1927 MAV_COMP_ID_SERVO2 = 141,
1928 #[doc = "Servo #3."]
1929 MAV_COMP_ID_SERVO3 = 142,
1930 #[doc = "Servo #4."]
1931 MAV_COMP_ID_SERVO4 = 143,
1932 #[doc = "Servo #5."]
1933 MAV_COMP_ID_SERVO5 = 144,
1934 #[doc = "Servo #6."]
1935 MAV_COMP_ID_SERVO6 = 145,
1936 #[doc = "Servo #7."]
1937 MAV_COMP_ID_SERVO7 = 146,
1938 #[doc = "Servo #8."]
1939 MAV_COMP_ID_SERVO8 = 147,
1940 #[doc = "Servo #9."]
1941 MAV_COMP_ID_SERVO9 = 148,
1942 #[doc = "Servo #10."]
1943 MAV_COMP_ID_SERVO10 = 149,
1944 #[doc = "Servo #11."]
1945 MAV_COMP_ID_SERVO11 = 150,
1946 #[doc = "Servo #12."]
1947 MAV_COMP_ID_SERVO12 = 151,
1948 #[doc = "Servo #13."]
1949 MAV_COMP_ID_SERVO13 = 152,
1950 #[doc = "Servo #14."]
1951 MAV_COMP_ID_SERVO14 = 153,
1952 #[doc = "Gimbal #1."]
1953 MAV_COMP_ID_GIMBAL = 154,
1954 #[doc = "Logging component."]
1955 MAV_COMP_ID_LOG = 155,
1956 #[doc = "Automatic Dependent Surveillance-Broadcast (ADS-B) component."]
1957 MAV_COMP_ID_ADSB = 156,
1958 #[doc = "On Screen Display (OSD) devices for video links."]
1959 MAV_COMP_ID_OSD = 157,
1960 #[doc = "Generic autopilot peripheral component ID. Meant for devices that do not implement the parameter microservice."]
1961 MAV_COMP_ID_PERIPHERAL = 158,
1962 #[deprecated = "All gimbals should use MAV_COMP_ID_GIMBAL. See `MAV_COMP_ID_GIMBAL` (Deprecated since 2018-11)"]
1963 #[doc = "Gimbal ID for QX1."]
1964 MAV_COMP_ID_QX1_GIMBAL = 159,
1965 #[doc = "FLARM collision alert component."]
1966 MAV_COMP_ID_FLARM = 160,
1967 #[doc = "Parachute component."]
1968 MAV_COMP_ID_PARACHUTE = 161,
1969 #[doc = "Winch component."]
1970 MAV_COMP_ID_WINCH = 169,
1971 #[doc = "Gimbal #2."]
1972 MAV_COMP_ID_GIMBAL2 = 171,
1973 #[doc = "Gimbal #3."]
1974 MAV_COMP_ID_GIMBAL3 = 172,
1975 #[doc = "Gimbal #4"]
1976 MAV_COMP_ID_GIMBAL4 = 173,
1977 #[doc = "Gimbal #5."]
1978 MAV_COMP_ID_GIMBAL5 = 174,
1979 #[doc = "Gimbal #6."]
1980 MAV_COMP_ID_GIMBAL6 = 175,
1981 #[doc = "Battery #1."]
1982 MAV_COMP_ID_BATTERY = 180,
1983 #[doc = "Battery #2."]
1984 MAV_COMP_ID_BATTERY2 = 181,
1985 #[doc = "CAN over MAVLink client."]
1986 MAV_COMP_ID_MAVCAN = 189,
1987 #[doc = "Component that can generate/supply a mission flight plan (e.g. GCS or developer API)."]
1988 MAV_COMP_ID_MISSIONPLANNER = 190,
1989 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
1990 MAV_COMP_ID_ONBOARD_COMPUTER = 191,
1991 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
1992 MAV_COMP_ID_ONBOARD_COMPUTER2 = 192,
1993 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
1994 MAV_COMP_ID_ONBOARD_COMPUTER3 = 193,
1995 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
1996 MAV_COMP_ID_ONBOARD_COMPUTER4 = 194,
1997 #[doc = "Component that finds an optimal path between points based on a certain constraint (e.g. minimum snap, shortest path, cost, etc.)."]
1998 MAV_COMP_ID_PATHPLANNER = 195,
1999 #[doc = "Component that plans a collision free path between two points."]
2000 MAV_COMP_ID_OBSTACLE_AVOIDANCE = 196,
2001 #[doc = "Component that provides position estimates using VIO techniques."]
2002 MAV_COMP_ID_VISUAL_INERTIAL_ODOMETRY = 197,
2003 #[doc = "Component that manages pairing of vehicle and GCS."]
2004 MAV_COMP_ID_PAIRING_MANAGER = 198,
2005 #[doc = "Inertial Measurement Unit (IMU) #1."]
2006 MAV_COMP_ID_IMU = 200,
2007 #[doc = "Inertial Measurement Unit (IMU) #2."]
2008 MAV_COMP_ID_IMU_2 = 201,
2009 #[doc = "Inertial Measurement Unit (IMU) #3."]
2010 MAV_COMP_ID_IMU_3 = 202,
2011 #[doc = "GPS #1."]
2012 MAV_COMP_ID_GPS = 220,
2013 #[doc = "GPS #2."]
2014 MAV_COMP_ID_GPS2 = 221,
2015 #[doc = "Open Drone ID transmitter/receiver (Bluetooth/WiFi/Internet)."]
2016 MAV_COMP_ID_ODID_TXRX_1 = 236,
2017 #[doc = "Open Drone ID transmitter/receiver (Bluetooth/WiFi/Internet)."]
2018 MAV_COMP_ID_ODID_TXRX_2 = 237,
2019 #[doc = "Open Drone ID transmitter/receiver (Bluetooth/WiFi/Internet)."]
2020 MAV_COMP_ID_ODID_TXRX_3 = 238,
2021 #[doc = "Component to bridge MAVLink to UDP (i.e. from a UART)."]
2022 MAV_COMP_ID_UDP_BRIDGE = 240,
2023 #[doc = "Component to bridge to UART (i.e. from UDP)."]
2024 MAV_COMP_ID_UART_BRIDGE = 241,
2025 #[doc = "Component handling TUNNEL messages (e.g. vendor specific GUI of a component)."]
2026 MAV_COMP_ID_TUNNEL_NODE = 242,
2027 #[doc = "Illuminator"]
2028 MAV_COMP_ID_ILLUMINATOR = 243,
2029 #[deprecated = "System control does not require a separate component ID. Instead, system commands should be sent with target_component=MAV_COMP_ID_ALL allowing the target component to use any appropriate component id. See `MAV_COMP_ID_ALL` (Deprecated since 2018-11)"]
2030 #[doc = "Deprecated, don't use. Component for handling system messages (e.g. to ARM, takeoff, etc.)."]
2031 MAV_COMP_ID_SYSTEM_CONTROL = 250,
2032}
2033impl MavComponent {
2034 pub const DEFAULT: Self = Self::MAV_COMP_ID_ALL;
2035}
2036impl Default for MavComponent {
2037 fn default() -> Self {
2038 Self::DEFAULT
2039 }
2040}
2041#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2042#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2043#[cfg_attr(feature = "serde", serde(tag = "type"))]
2044#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2045#[repr(u32)]
2046#[deprecated = " See `MESSAGE_INTERVAL` (Deprecated since 2015-06)"]
2047#[doc = "A data stream is not a fixed set of messages, but rather a recommendation to the autopilot software. Individual autopilots may or may not obey the recommended messages."]
2048pub enum MavDataStream {
2049 #[doc = "Enable all data streams"]
2050 MAV_DATA_STREAM_ALL = 0,
2051 #[doc = "Enable IMU_RAW, GPS_RAW, GPS_STATUS packets."]
2052 MAV_DATA_STREAM_RAW_SENSORS = 1,
2053 #[doc = "Enable GPS_STATUS, CONTROL_STATUS, AUX_STATUS"]
2054 MAV_DATA_STREAM_EXTENDED_STATUS = 2,
2055 #[doc = "Enable RC_CHANNELS_SCALED, RC_CHANNELS_RAW, SERVO_OUTPUT_RAW"]
2056 MAV_DATA_STREAM_RC_CHANNELS = 3,
2057 #[doc = "Enable ATTITUDE_CONTROLLER_OUTPUT, POSITION_CONTROLLER_OUTPUT, NAV_CONTROLLER_OUTPUT."]
2058 MAV_DATA_STREAM_RAW_CONTROLLER = 4,
2059 #[doc = "Enable LOCAL_POSITION, GLOBAL_POSITION_INT messages."]
2060 MAV_DATA_STREAM_POSITION = 6,
2061 #[doc = "Dependent on the autopilot"]
2062 MAV_DATA_STREAM_EXTRA1 = 10,
2063 #[doc = "Dependent on the autopilot"]
2064 MAV_DATA_STREAM_EXTRA2 = 11,
2065 #[doc = "Dependent on the autopilot"]
2066 MAV_DATA_STREAM_EXTRA3 = 12,
2067}
2068impl MavDataStream {
2069 pub const DEFAULT: Self = Self::MAV_DATA_STREAM_ALL;
2070}
2071impl Default for MavDataStream {
2072 fn default() -> Self {
2073 Self::DEFAULT
2074 }
2075}
2076#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2077#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2078#[cfg_attr(feature = "serde", serde(tag = "type"))]
2079#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2080#[repr(u32)]
2081#[doc = "Enumeration of distance sensor types"]
2082pub enum MavDistanceSensor {
2083 #[doc = "Laser rangefinder, e.g. LightWare SF02/F or PulsedLight units"]
2084 MAV_DISTANCE_SENSOR_LASER = 0,
2085 #[doc = "Ultrasound rangefinder, e.g. MaxBotix units"]
2086 MAV_DISTANCE_SENSOR_ULTRASOUND = 1,
2087 #[doc = "Infrared rangefinder, e.g. Sharp units"]
2088 MAV_DISTANCE_SENSOR_INFRARED = 2,
2089 #[doc = "Radar type, e.g. uLanding units"]
2090 MAV_DISTANCE_SENSOR_RADAR = 3,
2091 #[doc = "Broken or unknown type, e.g. analog units"]
2092 MAV_DISTANCE_SENSOR_UNKNOWN = 4,
2093}
2094impl MavDistanceSensor {
2095 pub const DEFAULT: Self = Self::MAV_DISTANCE_SENSOR_LASER;
2096}
2097impl Default for MavDistanceSensor {
2098 fn default() -> Self {
2099 Self::DEFAULT
2100 }
2101}
2102#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2103#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2104#[cfg_attr(feature = "serde", serde(tag = "type"))]
2105#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2106#[repr(u32)]
2107#[doc = "Bitmap of options for the MAV_CMD_DO_REPOSITION"]
2108pub enum MavDoRepositionFlags {
2109 #[doc = "The aircraft should immediately transition into guided. This should not be set for follow me applications"]
2110 MAV_DO_REPOSITION_FLAGS_CHANGE_MODE = 1,
2111}
2112impl MavDoRepositionFlags {
2113 pub const DEFAULT: Self = Self::MAV_DO_REPOSITION_FLAGS_CHANGE_MODE;
2114}
2115impl Default for MavDoRepositionFlags {
2116 fn default() -> Self {
2117 Self::DEFAULT
2118 }
2119}
2120#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2121#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2122#[cfg_attr(feature = "serde", serde(tag = "type"))]
2123#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2124#[repr(u32)]
2125#[doc = "Enumeration of estimator types"]
2126pub enum MavEstimatorType {
2127 #[doc = "Unknown type of the estimator."]
2128 MAV_ESTIMATOR_TYPE_UNKNOWN = 0,
2129 #[doc = "This is a naive estimator without any real covariance feedback."]
2130 MAV_ESTIMATOR_TYPE_NAIVE = 1,
2131 #[doc = "Computer vision based estimate. Might be up to scale."]
2132 MAV_ESTIMATOR_TYPE_VISION = 2,
2133 #[doc = "Visual-inertial estimate."]
2134 MAV_ESTIMATOR_TYPE_VIO = 3,
2135 #[doc = "Plain GPS estimate."]
2136 MAV_ESTIMATOR_TYPE_GPS = 4,
2137 #[doc = "Estimator integrating GPS and inertial sensing."]
2138 MAV_ESTIMATOR_TYPE_GPS_INS = 5,
2139 #[doc = "Estimate from external motion capturing system."]
2140 MAV_ESTIMATOR_TYPE_MOCAP = 6,
2141 #[doc = "Estimator based on lidar sensor input."]
2142 MAV_ESTIMATOR_TYPE_LIDAR = 7,
2143 #[doc = "Estimator on autopilot."]
2144 MAV_ESTIMATOR_TYPE_AUTOPILOT = 8,
2145}
2146impl MavEstimatorType {
2147 pub const DEFAULT: Self = Self::MAV_ESTIMATOR_TYPE_UNKNOWN;
2148}
2149impl Default for MavEstimatorType {
2150 fn default() -> Self {
2151 Self::DEFAULT
2152 }
2153}
2154#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2155#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2156#[cfg_attr(feature = "serde", serde(tag = "type"))]
2157#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2158#[repr(u32)]
2159#[doc = "Flags for CURRENT_EVENT_SEQUENCE."]
2160pub enum MavEventCurrentSequenceFlags {
2161 #[doc = "A sequence reset has happened (e.g. vehicle reboot)."]
2162 MAV_EVENT_CURRENT_SEQUENCE_FLAGS_RESET = 1,
2163}
2164impl MavEventCurrentSequenceFlags {
2165 pub const DEFAULT: Self = Self::MAV_EVENT_CURRENT_SEQUENCE_FLAGS_RESET;
2166}
2167impl Default for MavEventCurrentSequenceFlags {
2168 fn default() -> Self {
2169 Self::DEFAULT
2170 }
2171}
2172#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2173#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2174#[cfg_attr(feature = "serde", serde(tag = "type"))]
2175#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2176#[repr(u32)]
2177#[doc = "Reason for an event error response."]
2178pub enum MavEventErrorReason {
2179 #[doc = "The requested event is not available (anymore)."]
2180 MAV_EVENT_ERROR_REASON_UNAVAILABLE = 0,
2181}
2182impl MavEventErrorReason {
2183 pub const DEFAULT: Self = Self::MAV_EVENT_ERROR_REASON_UNAVAILABLE;
2184}
2185impl Default for MavEventErrorReason {
2186 fn default() -> Self {
2187 Self::DEFAULT
2188 }
2189}
2190#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2191#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2192#[cfg_attr(feature = "serde", serde(tag = "type"))]
2193#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2194#[repr(u32)]
2195#[doc = "Coordinate frames used by MAVLink. Not all frames are supported by all commands, messages, or vehicles. Global frames use the following naming conventions: - \"GLOBAL\": Global coordinate frame with WGS84 latitude/longitude and altitude positive over mean sea level (MSL) by default. The following modifiers may be used with \"GLOBAL\": - \"RELATIVE_ALT\": Altitude is relative to the vehicle home position rather than MSL. - \"TERRAIN_ALT\": Altitude is relative to ground level rather than MSL. - \"INT\": Latitude/longitude (in degrees) are scaled by multiplying by 1E7. Local frames use the following naming conventions: - \"LOCAL\": Origin of local frame is fixed relative to earth. Unless otherwise specified this origin is the origin of the vehicle position-estimator (\"EKF\"). - \"BODY\": Origin of local frame travels with the vehicle. NOTE, \"BODY\" does NOT indicate alignment of frame axis with vehicle attitude. - \"OFFSET\": Deprecated synonym for \"BODY\" (origin travels with the vehicle). Not to be used for new frames. Some deprecated frames do not follow these conventions (e.g. MAV_FRAME_BODY_NED and MAV_FRAME_BODY_OFFSET_NED)."]
2196pub enum MavFrame {
2197 #[doc = "Global (WGS84) coordinate frame + altitude relative to mean sea level (MSL)."]
2198 MAV_FRAME_GLOBAL = 0,
2199 #[doc = "NED local tangent frame (x: North, y: East, z: Down) with origin fixed relative to earth."]
2200 MAV_FRAME_LOCAL_NED = 1,
2201 #[doc = "NOT a coordinate frame, indicates a mission command."]
2202 MAV_FRAME_MISSION = 2,
2203 #[doc = "Global (WGS84) coordinate frame + altitude relative to the home position."]
2204 MAV_FRAME_GLOBAL_RELATIVE_ALT = 3,
2205 #[doc = "ENU local tangent frame (x: East, y: North, z: Up) with origin fixed relative to earth."]
2206 MAV_FRAME_LOCAL_ENU = 4,
2207 #[deprecated = "Use MAV_FRAME_GLOBAL in COMMAND_INT (and elsewhere) as a synonymous replacement. See `MAV_FRAME_GLOBAL` (Deprecated since 2024-03)"]
2208 #[doc = "Global (WGS84) coordinate frame (scaled) + altitude relative to mean sea level (MSL)."]
2209 MAV_FRAME_GLOBAL_INT = 5,
2210 #[deprecated = "Use MAV_FRAME_GLOBAL_RELATIVE_ALT in COMMAND_INT (and elsewhere) as a synonymous replacement. See `MAV_FRAME_GLOBAL_RELATIVE_ALT` (Deprecated since 2024-03)"]
2211 #[doc = "Global (WGS84) coordinate frame (scaled) + altitude relative to the home position."]
2212 MAV_FRAME_GLOBAL_RELATIVE_ALT_INT = 6,
2213 #[doc = "NED local tangent frame (x: North, y: East, z: Down) with origin that travels with the vehicle."]
2214 MAV_FRAME_LOCAL_OFFSET_NED = 7,
2215 #[deprecated = " See `MAV_FRAME_BODY_FRD` (Deprecated since 2019-08)"]
2216 #[doc = "Same as MAV_FRAME_LOCAL_NED when used to represent position values. Same as MAV_FRAME_BODY_FRD when used with velocity/acceleration values."]
2217 MAV_FRAME_BODY_NED = 8,
2218 #[deprecated = " See `MAV_FRAME_BODY_FRD` (Deprecated since 2019-08)"]
2219 #[doc = "This is the same as MAV_FRAME_BODY_FRD."]
2220 MAV_FRAME_BODY_OFFSET_NED = 9,
2221 #[doc = "Global (WGS84) coordinate frame with AGL altitude (altitude at ground level)."]
2222 MAV_FRAME_GLOBAL_TERRAIN_ALT = 10,
2223 #[deprecated = "Use MAV_FRAME_GLOBAL_TERRAIN_ALT in COMMAND_INT (and elsewhere) as a synonymous replacement. See `MAV_FRAME_GLOBAL_TERRAIN_ALT` (Deprecated since 2024-03)"]
2224 #[doc = "Global (WGS84) coordinate frame (scaled) with AGL altitude (altitude at ground level)."]
2225 MAV_FRAME_GLOBAL_TERRAIN_ALT_INT = 11,
2226 #[doc = "FRD local frame aligned to the vehicle's attitude (x: Forward, y: Right, z: Down) with an origin that travels with vehicle."]
2227 MAV_FRAME_BODY_FRD = 12,
2228 #[deprecated = " (Deprecated since 2019-04)"]
2229 #[doc = "MAV_FRAME_BODY_FLU - Body fixed frame of reference, Z-up (x: Forward, y: Left, z: Up)."]
2230 MAV_FRAME_RESERVED_13 = 13,
2231 #[deprecated = " See `MAV_FRAME_LOCAL_FRD` (Deprecated since 2019-04)"]
2232 #[doc = "MAV_FRAME_MOCAP_NED - Odometry local coordinate frame of data given by a motion capture system, Z-down (x: North, y: East, z: Down)."]
2233 MAV_FRAME_RESERVED_14 = 14,
2234 #[deprecated = " See `MAV_FRAME_LOCAL_FLU` (Deprecated since 2019-04)"]
2235 #[doc = "MAV_FRAME_MOCAP_ENU - Odometry local coordinate frame of data given by a motion capture system, Z-up (x: East, y: North, z: Up)."]
2236 MAV_FRAME_RESERVED_15 = 15,
2237 #[deprecated = " See `MAV_FRAME_LOCAL_FRD` (Deprecated since 2019-04)"]
2238 #[doc = "MAV_FRAME_VISION_NED - Odometry local coordinate frame of data given by a vision estimation system, Z-down (x: North, y: East, z: Down)."]
2239 MAV_FRAME_RESERVED_16 = 16,
2240 #[deprecated = " See `MAV_FRAME_LOCAL_FLU` (Deprecated since 2019-04)"]
2241 #[doc = "MAV_FRAME_VISION_ENU - Odometry local coordinate frame of data given by a vision estimation system, Z-up (x: East, y: North, z: Up)."]
2242 MAV_FRAME_RESERVED_17 = 17,
2243 #[deprecated = " See `MAV_FRAME_LOCAL_FRD` (Deprecated since 2019-04)"]
2244 #[doc = "MAV_FRAME_ESTIM_NED - Odometry local coordinate frame of data given by an estimator running onboard the vehicle, Z-down (x: North, y: East, z: Down)."]
2245 MAV_FRAME_RESERVED_18 = 18,
2246 #[deprecated = " See `MAV_FRAME_LOCAL_FLU` (Deprecated since 2019-04)"]
2247 #[doc = "MAV_FRAME_ESTIM_ENU - Odometry local coordinate frame of data given by an estimator running onboard the vehicle, Z-up (x: East, y: North, z: Up)."]
2248 MAV_FRAME_RESERVED_19 = 19,
2249 #[doc = "FRD local tangent frame (x: Forward, y: Right, z: Down) with origin fixed relative to earth. The forward axis is aligned to the front of the vehicle in the horizontal plane."]
2250 MAV_FRAME_LOCAL_FRD = 20,
2251 #[doc = "FLU local tangent frame (x: Forward, y: Left, z: Up) with origin fixed relative to earth. The forward axis is aligned to the front of the vehicle in the horizontal plane."]
2252 MAV_FRAME_LOCAL_FLU = 21,
2253}
2254impl MavFrame {
2255 pub const DEFAULT: Self = Self::MAV_FRAME_GLOBAL;
2256}
2257impl Default for MavFrame {
2258 fn default() -> Self {
2259 Self::DEFAULT
2260 }
2261}
2262#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2263#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2264#[cfg_attr(feature = "serde", serde(tag = "type"))]
2265#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2266#[repr(u32)]
2267#[doc = "MAV FTP error codes (<https://mavlink.io/en/services/ftp.html>)"]
2268pub enum MavFtpErr {
2269 #[doc = "None: No error"]
2270 MAV_FTP_ERR_NONE = 0,
2271 #[doc = "Fail: Unknown failure"]
2272 MAV_FTP_ERR_FAIL = 1,
2273 #[doc = "FailErrno: Command failed, Err number sent back in PayloadHeader.data[1]. \t\tThis is a file-system error number understood by the server operating system."]
2274 MAV_FTP_ERR_FAILERRNO = 2,
2275 #[doc = "InvalidDataSize: Payload size is invalid"]
2276 MAV_FTP_ERR_INVALIDDATASIZE = 3,
2277 #[doc = "InvalidSession: Session is not currently open"]
2278 MAV_FTP_ERR_INVALIDSESSION = 4,
2279 #[doc = "NoSessionsAvailable: All available sessions are already in use"]
2280 MAV_FTP_ERR_NOSESSIONSAVAILABLE = 5,
2281 #[doc = "EOF: Offset past end of file for ListDirectory and ReadFile commands"]
2282 MAV_FTP_ERR_EOF = 6,
2283 #[doc = "UnknownCommand: Unknown command / opcode"]
2284 MAV_FTP_ERR_UNKNOWNCOMMAND = 7,
2285 #[doc = "FileExists: File/directory already exists"]
2286 MAV_FTP_ERR_FILEEXISTS = 8,
2287 #[doc = "FileProtected: File/directory is write protected"]
2288 MAV_FTP_ERR_FILEPROTECTED = 9,
2289 #[doc = "FileNotFound: File/directory not found"]
2290 MAV_FTP_ERR_FILENOTFOUND = 10,
2291}
2292impl MavFtpErr {
2293 pub const DEFAULT: Self = Self::MAV_FTP_ERR_NONE;
2294}
2295impl Default for MavFtpErr {
2296 fn default() -> Self {
2297 Self::DEFAULT
2298 }
2299}
2300#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2301#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2302#[cfg_attr(feature = "serde", serde(tag = "type"))]
2303#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2304#[repr(u32)]
2305#[doc = "MAV FTP opcodes: <https://mavlink.io/en/services/ftp.html>"]
2306pub enum MavFtpOpcode {
2307 #[doc = "None. Ignored, always ACKed"]
2308 MAV_FTP_OPCODE_NONE = 0,
2309 #[doc = "TerminateSession: Terminates open Read session"]
2310 MAV_FTP_OPCODE_TERMINATESESSION = 1,
2311 #[doc = "ResetSessions: Terminates all open read sessions"]
2312 MAV_FTP_OPCODE_RESETSESSION = 2,
2313 #[doc = "ListDirectory. List files and directories in path from offset"]
2314 MAV_FTP_OPCODE_LISTDIRECTORY = 3,
2315 #[doc = "OpenFileRO: Opens file at path for reading, returns session"]
2316 MAV_FTP_OPCODE_OPENFILERO = 4,
2317 #[doc = "ReadFile: Reads size bytes from offset in session"]
2318 MAV_FTP_OPCODE_READFILE = 5,
2319 #[doc = "CreateFile: Creates file at path for writing, returns session"]
2320 MAV_FTP_OPCODE_CREATEFILE = 6,
2321 #[doc = "WriteFile: Writes size bytes to offset in session"]
2322 MAV_FTP_OPCODE_WRITEFILE = 7,
2323 #[doc = "RemoveFile: Remove file at path"]
2324 MAV_FTP_OPCODE_REMOVEFILE = 8,
2325 #[doc = "CreateDirectory: Creates directory at path"]
2326 MAV_FTP_OPCODE_CREATEDIRECTORY = 9,
2327 #[doc = "RemoveDirectory: Removes directory at path. The directory must be empty."]
2328 MAV_FTP_OPCODE_REMOVEDIRECTORY = 10,
2329 #[doc = "OpenFileWO: Opens file at path for writing, returns session"]
2330 MAV_FTP_OPCODE_OPENFILEWO = 11,
2331 #[doc = "TruncateFile: Truncate file at path to offset length"]
2332 MAV_FTP_OPCODE_TRUNCATEFILE = 12,
2333 #[doc = "Rename: Rename path1 to path2"]
2334 MAV_FTP_OPCODE_RENAME = 13,
2335 #[doc = "CalcFileCRC32: Calculate CRC32 for file at path"]
2336 MAV_FTP_OPCODE_CALCFILECRC = 14,
2337 #[doc = "BurstReadFile: Burst download session file"]
2338 MAV_FTP_OPCODE_BURSTREADFILE = 15,
2339 #[doc = "ACK: ACK response"]
2340 MAV_FTP_OPCODE_ACK = 128,
2341 #[doc = "NAK: NAK response"]
2342 MAV_FTP_OPCODE_NAK = 129,
2343}
2344impl MavFtpOpcode {
2345 pub const DEFAULT: Self = Self::MAV_FTP_OPCODE_NONE;
2346}
2347impl Default for MavFtpOpcode {
2348 fn default() -> Self {
2349 Self::DEFAULT
2350 }
2351}
2352#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2353#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2354#[cfg_attr(feature = "serde", serde(tag = "type"))]
2355#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2356#[repr(u32)]
2357#[doc = "Fuel types for use in FUEL_TYPE. Fuel types specify the units for the maximum, available and consumed fuel, and for the flow rates."]
2358pub enum MavFuelType {
2359 #[doc = "Not specified. Fuel levels are normalized (i.e. maximum is 1, and other levels are relative to 1)."]
2360 MAV_FUEL_TYPE_UNKNOWN = 0,
2361 #[doc = "A generic liquid fuel. Fuel levels are in millilitres (ml). Fuel rates are in millilitres/second."]
2362 MAV_FUEL_TYPE_LIQUID = 1,
2363 #[doc = "A gas tank. Fuel levels are in kilo-Pascal (kPa), and flow rates are in milliliters per second (ml/s)."]
2364 MAV_FUEL_TYPE_GAS = 2,
2365}
2366impl MavFuelType {
2367 pub const DEFAULT: Self = Self::MAV_FUEL_TYPE_UNKNOWN;
2368}
2369impl Default for MavFuelType {
2370 fn default() -> Self {
2371 Self::DEFAULT
2372 }
2373}
2374bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to report status/failure cases for a power generator (used in GENERATOR_STATUS). Note that FAULTS are conditions that cause the generator to fail. Warnings are conditions that require attention before the next use (they indicate the system is not operating properly)."] pub struct MavGeneratorStatusFlag : u64 { # [doc = "Generator is off."] const MAV_GENERATOR_STATUS_FLAG_OFF = 1 ; # [doc = "Generator is ready to start generating power."] const MAV_GENERATOR_STATUS_FLAG_READY = 2 ; # [doc = "Generator is generating power."] const MAV_GENERATOR_STATUS_FLAG_GENERATING = 4 ; # [doc = "Generator is charging the batteries (generating enough power to charge and provide the load)."] const MAV_GENERATOR_STATUS_FLAG_CHARGING = 8 ; # [doc = "Generator is operating at a reduced maximum power."] const MAV_GENERATOR_STATUS_FLAG_REDUCED_POWER = 16 ; # [doc = "Generator is providing the maximum output."] const MAV_GENERATOR_STATUS_FLAG_MAXPOWER = 32 ; # [doc = "Generator is near the maximum operating temperature, cooling is insufficient."] const MAV_GENERATOR_STATUS_FLAG_OVERTEMP_WARNING = 64 ; # [doc = "Generator hit the maximum operating temperature and shutdown."] const MAV_GENERATOR_STATUS_FLAG_OVERTEMP_FAULT = 128 ; # [doc = "Power electronics are near the maximum operating temperature, cooling is insufficient."] const MAV_GENERATOR_STATUS_FLAG_ELECTRONICS_OVERTEMP_WARNING = 256 ; # [doc = "Power electronics hit the maximum operating temperature and shutdown."] const MAV_GENERATOR_STATUS_FLAG_ELECTRONICS_OVERTEMP_FAULT = 512 ; # [doc = "Power electronics experienced a fault and shutdown."] const MAV_GENERATOR_STATUS_FLAG_ELECTRONICS_FAULT = 1024 ; # [doc = "The power source supplying the generator failed e.g. mechanical generator stopped, tether is no longer providing power, solar cell is in shade, hydrogen reaction no longer happening."] const MAV_GENERATOR_STATUS_FLAG_POWERSOURCE_FAULT = 2048 ; # [doc = "Generator controller having communication problems."] const MAV_GENERATOR_STATUS_FLAG_COMMUNICATION_WARNING = 4096 ; # [doc = "Power electronic or generator cooling system error."] const MAV_GENERATOR_STATUS_FLAG_COOLING_WARNING = 8192 ; # [doc = "Generator controller power rail experienced a fault."] const MAV_GENERATOR_STATUS_FLAG_POWER_RAIL_FAULT = 16384 ; # [doc = "Generator controller exceeded the overcurrent threshold and shutdown to prevent damage."] const MAV_GENERATOR_STATUS_FLAG_OVERCURRENT_FAULT = 32768 ; # [doc = "Generator controller detected a high current going into the batteries and shutdown to prevent battery damage."] const MAV_GENERATOR_STATUS_FLAG_BATTERY_OVERCHARGE_CURRENT_FAULT = 65536 ; # [doc = "Generator controller exceeded it's overvoltage threshold and shutdown to prevent it exceeding the voltage rating."] const MAV_GENERATOR_STATUS_FLAG_OVERVOLTAGE_FAULT = 131072 ; # [doc = "Batteries are under voltage (generator will not start)."] const MAV_GENERATOR_STATUS_FLAG_BATTERY_UNDERVOLT_FAULT = 262144 ; # [doc = "Generator start is inhibited by e.g. a safety switch."] const MAV_GENERATOR_STATUS_FLAG_START_INHIBITED = 524288 ; # [doc = "Generator requires maintenance."] const MAV_GENERATOR_STATUS_FLAG_MAINTENANCE_REQUIRED = 1048576 ; # [doc = "Generator is not ready to generate yet."] const MAV_GENERATOR_STATUS_FLAG_WARMING_UP = 2097152 ; # [doc = "Generator is idle."] const MAV_GENERATOR_STATUS_FLAG_IDLE = 4194304 ; } }
2375impl MavGeneratorStatusFlag {
2376 pub const DEFAULT: Self = Self::MAV_GENERATOR_STATUS_FLAG_OFF;
2377}
2378impl Default for MavGeneratorStatusFlag {
2379 fn default() -> Self {
2380 Self::DEFAULT
2381 }
2382}
2383#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2384#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2385#[cfg_attr(feature = "serde", serde(tag = "type"))]
2386#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2387#[repr(u32)]
2388#[doc = "Actions that may be specified in MAV_CMD_OVERRIDE_GOTO to override mission execution."]
2389pub enum MavGoto {
2390 #[doc = "Hold at the current position."]
2391 MAV_GOTO_DO_HOLD = 0,
2392 #[doc = "Continue with the next item in mission execution."]
2393 MAV_GOTO_DO_CONTINUE = 1,
2394 #[doc = "Hold at the current position of the system"]
2395 MAV_GOTO_HOLD_AT_CURRENT_POSITION = 2,
2396 #[doc = "Hold at the position specified in the parameters of the DO_HOLD action"]
2397 MAV_GOTO_HOLD_AT_SPECIFIED_POSITION = 3,
2398}
2399impl MavGoto {
2400 pub const DEFAULT: Self = Self::MAV_GOTO_DO_HOLD;
2401}
2402impl Default for MavGoto {
2403 fn default() -> Self {
2404 Self::DEFAULT
2405 }
2406}
2407#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2408#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2409#[cfg_attr(feature = "serde", serde(tag = "type"))]
2410#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2411#[repr(u32)]
2412#[doc = "Enumeration of landed detector states"]
2413pub enum MavLandedState {
2414 #[doc = "MAV landed state is unknown"]
2415 MAV_LANDED_STATE_UNDEFINED = 0,
2416 #[doc = "MAV is landed (on ground)"]
2417 MAV_LANDED_STATE_ON_GROUND = 1,
2418 #[doc = "MAV is in air"]
2419 MAV_LANDED_STATE_IN_AIR = 2,
2420 #[doc = "MAV currently taking off"]
2421 MAV_LANDED_STATE_TAKEOFF = 3,
2422 #[doc = "MAV currently landing"]
2423 MAV_LANDED_STATE_LANDING = 4,
2424}
2425impl MavLandedState {
2426 pub const DEFAULT: Self = Self::MAV_LANDED_STATE_UNDEFINED;
2427}
2428impl Default for MavLandedState {
2429 fn default() -> Self {
2430 Self::DEFAULT
2431 }
2432}
2433#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2434#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2435#[cfg_attr(feature = "serde", serde(tag = "type"))]
2436#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2437#[repr(u32)]
2438#[doc = "Result of mission operation (in a MISSION_ACK message)."]
2439pub enum MavMissionResult {
2440 #[doc = "mission accepted OK"]
2441 MAV_MISSION_ACCEPTED = 0,
2442 #[doc = "Generic error / not accepting mission commands at all right now."]
2443 MAV_MISSION_ERROR = 1,
2444 #[doc = "Coordinate frame is not supported."]
2445 MAV_MISSION_UNSUPPORTED_FRAME = 2,
2446 #[doc = "Command is not supported."]
2447 MAV_MISSION_UNSUPPORTED = 3,
2448 #[doc = "Mission items exceed storage space."]
2449 MAV_MISSION_NO_SPACE = 4,
2450 #[doc = "One of the parameters has an invalid value."]
2451 MAV_MISSION_INVALID = 5,
2452 #[doc = "param1 has an invalid value."]
2453 MAV_MISSION_INVALID_PARAM1 = 6,
2454 #[doc = "param2 has an invalid value."]
2455 MAV_MISSION_INVALID_PARAM2 = 7,
2456 #[doc = "param3 has an invalid value."]
2457 MAV_MISSION_INVALID_PARAM3 = 8,
2458 #[doc = "param4 has an invalid value."]
2459 MAV_MISSION_INVALID_PARAM4 = 9,
2460 #[doc = "x / param5 has an invalid value."]
2461 MAV_MISSION_INVALID_PARAM5_X = 10,
2462 #[doc = "y / param6 has an invalid value."]
2463 MAV_MISSION_INVALID_PARAM6_Y = 11,
2464 #[doc = "z / param7 has an invalid value."]
2465 MAV_MISSION_INVALID_PARAM7 = 12,
2466 #[doc = "Mission item received out of sequence"]
2467 MAV_MISSION_INVALID_SEQUENCE = 13,
2468 #[doc = "Not accepting any mission commands from this communication partner."]
2469 MAV_MISSION_DENIED = 14,
2470 #[doc = "Current mission operation cancelled (e.g. mission upload, mission download)."]
2471 MAV_MISSION_OPERATION_CANCELLED = 15,
2472}
2473impl MavMissionResult {
2474 pub const DEFAULT: Self = Self::MAV_MISSION_ACCEPTED;
2475}
2476impl Default for MavMissionResult {
2477 fn default() -> Self {
2478 Self::DEFAULT
2479 }
2480}
2481#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2482#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2483#[cfg_attr(feature = "serde", serde(tag = "type"))]
2484#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2485#[repr(u32)]
2486#[doc = "Type of mission items being requested/sent in mission protocol."]
2487pub enum MavMissionType {
2488 #[doc = "Items are mission commands for main mission."]
2489 MAV_MISSION_TYPE_MISSION = 0,
2490 #[doc = "Specifies GeoFence area(s). Items are MAV_CMD_NAV_FENCE_ GeoFence items."]
2491 MAV_MISSION_TYPE_FENCE = 1,
2492 #[doc = "Specifies the rally points for the vehicle. Rally points are alternative RTL points. Items are MAV_CMD_NAV_RALLY_POINT rally point items."]
2493 MAV_MISSION_TYPE_RALLY = 2,
2494 #[doc = "Only used in MISSION_CLEAR_ALL to clear all mission types."]
2495 MAV_MISSION_TYPE_ALL = 255,
2496}
2497impl MavMissionType {
2498 pub const DEFAULT: Self = Self::MAV_MISSION_TYPE_MISSION;
2499}
2500impl Default for MavMissionType {
2501 fn default() -> Self {
2502 Self::DEFAULT
2503 }
2504}
2505#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2506#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2507#[cfg_attr(feature = "serde", serde(tag = "type"))]
2508#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2509#[repr(u32)]
2510#[doc = "These defines are predefined OR-combined mode flags. There is no need to use values from this enum, but it simplifies the use of the mode flags. Note that manual input is enabled in all modes as a safety override."]
2511pub enum MavMode {
2512 #[doc = "System is not ready to fly, booting, calibrating, etc. No flag is set."]
2513 MAV_MODE_PREFLIGHT = 0,
2514 #[doc = "System is allowed to be active, under assisted RC control."]
2515 MAV_MODE_STABILIZE_DISARMED = 80,
2516 #[doc = "System is allowed to be active, under assisted RC control."]
2517 MAV_MODE_STABILIZE_ARMED = 208,
2518 #[doc = "System is allowed to be active, under manual (RC) control, no stabilization"]
2519 MAV_MODE_MANUAL_DISARMED = 64,
2520 #[doc = "System is allowed to be active, under manual (RC) control, no stabilization"]
2521 MAV_MODE_MANUAL_ARMED = 192,
2522 #[doc = "System is allowed to be active, under autonomous control, manual setpoint"]
2523 MAV_MODE_GUIDED_DISARMED = 88,
2524 #[doc = "System is allowed to be active, under autonomous control, manual setpoint"]
2525 MAV_MODE_GUIDED_ARMED = 216,
2526 #[doc = "System is allowed to be active, under autonomous control and navigation (the trajectory is decided onboard and not pre-programmed by waypoints)"]
2527 MAV_MODE_AUTO_DISARMED = 92,
2528 #[doc = "System is allowed to be active, under autonomous control and navigation (the trajectory is decided onboard and not pre-programmed by waypoints)"]
2529 MAV_MODE_AUTO_ARMED = 220,
2530 #[doc = "UNDEFINED mode. This solely depends on the autopilot - use with caution, intended for developers only."]
2531 MAV_MODE_TEST_DISARMED = 66,
2532 #[doc = "UNDEFINED mode. This solely depends on the autopilot - use with caution, intended for developers only."]
2533 MAV_MODE_TEST_ARMED = 194,
2534}
2535impl MavMode {
2536 pub const DEFAULT: Self = Self::MAV_MODE_PREFLIGHT;
2537}
2538impl Default for MavMode {
2539 fn default() -> Self {
2540 Self::DEFAULT
2541 }
2542}
2543bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These flags encode the MAV mode."] pub struct MavModeFlag : u8 { # [doc = "0b10000000 MAV safety set to armed. Motors are enabled / running / can start. Ready to fly. Additional note: this flag is to be ignore when sent in the command MAV_CMD_DO_SET_MODE and MAV_CMD_COMPONENT_ARM_DISARM shall be used instead. The flag can still be used to report the armed state."] const MAV_MODE_FLAG_SAFETY_ARMED = 128 ; # [doc = "0b01000000 remote control input is enabled."] const MAV_MODE_FLAG_MANUAL_INPUT_ENABLED = 64 ; # [doc = "0b00100000 hardware in the loop simulation. All motors / actuators are blocked, but internal software is full operational."] const MAV_MODE_FLAG_HIL_ENABLED = 32 ; # [doc = "0b00010000 system stabilizes electronically its attitude (and optionally position). It needs however further control inputs to move around."] const MAV_MODE_FLAG_STABILIZE_ENABLED = 16 ; # [doc = "0b00001000 guided mode enabled, system flies waypoints / mission items."] const MAV_MODE_FLAG_GUIDED_ENABLED = 8 ; # [doc = "0b00000100 autonomous mode enabled, system finds its own goal positions. Guided flag can be set or not, depends on the actual implementation."] const MAV_MODE_FLAG_AUTO_ENABLED = 4 ; # [doc = "0b00000010 system has a test mode enabled. This flag is intended for temporary system tests and should not be used for stable implementations."] const MAV_MODE_FLAG_TEST_ENABLED = 2 ; # [doc = "0b00000001 Reserved for future use."] const MAV_MODE_FLAG_CUSTOM_MODE_ENABLED = 1 ; } }
2544impl MavModeFlag {
2545 pub const DEFAULT: Self = Self::MAV_MODE_FLAG_SAFETY_ARMED;
2546}
2547impl Default for MavModeFlag {
2548 fn default() -> Self {
2549 Self::DEFAULT
2550 }
2551}
2552#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2553#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2554#[cfg_attr(feature = "serde", serde(tag = "type"))]
2555#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2556#[repr(u32)]
2557#[doc = "These values encode the bit positions of the decode position. These values can be used to read the value of a flag bit by combining the base_mode variable with AND with the flag position value. The result will be either 0 or 1, depending on if the flag is set or not."]
2558pub enum MavModeFlagDecodePosition {
2559 #[doc = "First bit: 10000000"]
2560 MAV_MODE_FLAG_DECODE_POSITION_SAFETY = 128,
2561 #[doc = "Second bit: 01000000"]
2562 MAV_MODE_FLAG_DECODE_POSITION_MANUAL = 64,
2563 #[doc = "Third bit: 00100000"]
2564 MAV_MODE_FLAG_DECODE_POSITION_HIL = 32,
2565 #[doc = "Fourth bit: 00010000"]
2566 MAV_MODE_FLAG_DECODE_POSITION_STABILIZE = 16,
2567 #[doc = "Fifth bit: 00001000"]
2568 MAV_MODE_FLAG_DECODE_POSITION_GUIDED = 8,
2569 #[doc = "Sixth bit: 00000100"]
2570 MAV_MODE_FLAG_DECODE_POSITION_AUTO = 4,
2571 #[doc = "Seventh bit: 00000010"]
2572 MAV_MODE_FLAG_DECODE_POSITION_TEST = 2,
2573 #[doc = "Eighth bit: 00000001"]
2574 MAV_MODE_FLAG_DECODE_POSITION_CUSTOM_MODE = 1,
2575}
2576impl MavModeFlagDecodePosition {
2577 pub const DEFAULT: Self = Self::MAV_MODE_FLAG_DECODE_POSITION_SAFETY;
2578}
2579impl Default for MavModeFlagDecodePosition {
2580 fn default() -> Self {
2581 Self::DEFAULT
2582 }
2583}
2584bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Mode properties."] pub struct MavModeProperty : u32 { # [doc = "If set, this mode is an advanced mode. For example a rate-controlled manual mode might be advanced, whereas a position-controlled manual mode is not. A GCS can optionally use this flag to configure the UI for its intended users."] const MAV_MODE_PROPERTY_ADVANCED = 1 ; # [doc = "If set, this mode should not be added to the list of selectable modes. The mode might still be selected by the FC directly (for example as part of a failsafe)."] const MAV_MODE_PROPERTY_NOT_USER_SELECTABLE = 2 ; # [doc = "If set, this mode is automatically controlled (it may use but does not require a manual controller). If unset the mode is a assumed to require user input (be a manual mode)."] const MAV_MODE_PROPERTY_AUTO_MODE = 4 ; } }
2585impl MavModeProperty {
2586 pub const DEFAULT: Self = Self::MAV_MODE_PROPERTY_ADVANCED;
2587}
2588impl Default for MavModeProperty {
2589 fn default() -> Self {
2590 Self::DEFAULT
2591 }
2592}
2593#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2594#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2595#[cfg_attr(feature = "serde", serde(tag = "type"))]
2596#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2597#[repr(u32)]
2598#[deprecated = " See `GIMBAL_MANAGER_FLAGS` (Deprecated since 2020-01)"]
2599#[doc = "Enumeration of possible mount operation modes. This message is used by obsolete/deprecated gimbal messages."]
2600pub enum MavMountMode {
2601 #[doc = "Load and keep safe position (Roll,Pitch,Yaw) from permanent memory and stop stabilization"]
2602 MAV_MOUNT_MODE_RETRACT = 0,
2603 #[doc = "Load and keep neutral position (Roll,Pitch,Yaw) from permanent memory."]
2604 MAV_MOUNT_MODE_NEUTRAL = 1,
2605 #[doc = "Load neutral position and start MAVLink Roll,Pitch,Yaw control with stabilization"]
2606 MAV_MOUNT_MODE_MAVLINK_TARGETING = 2,
2607 #[doc = "Load neutral position and start RC Roll,Pitch,Yaw control with stabilization"]
2608 MAV_MOUNT_MODE_RC_TARGETING = 3,
2609 #[doc = "Load neutral position and start to point to Lat,Lon,Alt"]
2610 MAV_MOUNT_MODE_GPS_POINT = 4,
2611 #[doc = "Gimbal tracks system with specified system ID"]
2612 MAV_MOUNT_MODE_SYSID_TARGET = 5,
2613 #[doc = "Gimbal tracks home position"]
2614 MAV_MOUNT_MODE_HOME_LOCATION = 6,
2615}
2616impl MavMountMode {
2617 pub const DEFAULT: Self = Self::MAV_MOUNT_MODE_RETRACT;
2618}
2619impl Default for MavMountMode {
2620 fn default() -> Self {
2621 Self::DEFAULT
2622 }
2623}
2624#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2625#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2626#[cfg_attr(feature = "serde", serde(tag = "type"))]
2627#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2628#[repr(u32)]
2629pub enum MavOdidArmStatus {
2630 #[doc = "Passing arming checks."]
2631 MAV_ODID_ARM_STATUS_GOOD_TO_ARM = 0,
2632 #[doc = "Generic arming failure, see error string for details."]
2633 MAV_ODID_ARM_STATUS_PRE_ARM_FAIL_GENERIC = 1,
2634}
2635impl MavOdidArmStatus {
2636 pub const DEFAULT: Self = Self::MAV_ODID_ARM_STATUS_GOOD_TO_ARM;
2637}
2638impl Default for MavOdidArmStatus {
2639 fn default() -> Self {
2640 Self::DEFAULT
2641 }
2642}
2643#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2644#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2645#[cfg_attr(feature = "serde", serde(tag = "type"))]
2646#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2647#[repr(u32)]
2648pub enum MavOdidAuthType {
2649 #[doc = "No authentication type is specified."]
2650 MAV_ODID_AUTH_TYPE_NONE = 0,
2651 #[doc = "Signature for the UAS (Unmanned Aircraft System) ID."]
2652 MAV_ODID_AUTH_TYPE_UAS_ID_SIGNATURE = 1,
2653 #[doc = "Signature for the Operator ID."]
2654 MAV_ODID_AUTH_TYPE_OPERATOR_ID_SIGNATURE = 2,
2655 #[doc = "Signature for the entire message set."]
2656 MAV_ODID_AUTH_TYPE_MESSAGE_SET_SIGNATURE = 3,
2657 #[doc = "Authentication is provided by Network Remote ID."]
2658 MAV_ODID_AUTH_TYPE_NETWORK_REMOTE_ID = 4,
2659 #[doc = "The exact authentication type is indicated by the first byte of authentication_data and these type values are managed by ICAO."]
2660 MAV_ODID_AUTH_TYPE_SPECIFIC_AUTHENTICATION = 5,
2661}
2662impl MavOdidAuthType {
2663 pub const DEFAULT: Self = Self::MAV_ODID_AUTH_TYPE_NONE;
2664}
2665impl Default for MavOdidAuthType {
2666 fn default() -> Self {
2667 Self::DEFAULT
2668 }
2669}
2670#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2671#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2672#[cfg_attr(feature = "serde", serde(tag = "type"))]
2673#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2674#[repr(u32)]
2675pub enum MavOdidCategoryEu {
2676 #[doc = "The category for the UA, according to the EU specification, is undeclared."]
2677 MAV_ODID_CATEGORY_EU_UNDECLARED = 0,
2678 #[doc = "The category for the UA, according to the EU specification, is the Open category."]
2679 MAV_ODID_CATEGORY_EU_OPEN = 1,
2680 #[doc = "The category for the UA, according to the EU specification, is the Specific category."]
2681 MAV_ODID_CATEGORY_EU_SPECIFIC = 2,
2682 #[doc = "The category for the UA, according to the EU specification, is the Certified category."]
2683 MAV_ODID_CATEGORY_EU_CERTIFIED = 3,
2684}
2685impl MavOdidCategoryEu {
2686 pub const DEFAULT: Self = Self::MAV_ODID_CATEGORY_EU_UNDECLARED;
2687}
2688impl Default for MavOdidCategoryEu {
2689 fn default() -> Self {
2690 Self::DEFAULT
2691 }
2692}
2693#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2694#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2695#[cfg_attr(feature = "serde", serde(tag = "type"))]
2696#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2697#[repr(u32)]
2698pub enum MavOdidClassEu {
2699 #[doc = "The class for the UA, according to the EU specification, is undeclared."]
2700 MAV_ODID_CLASS_EU_UNDECLARED = 0,
2701 #[doc = "The class for the UA, according to the EU specification, is Class 0."]
2702 MAV_ODID_CLASS_EU_CLASS_0 = 1,
2703 #[doc = "The class for the UA, according to the EU specification, is Class 1."]
2704 MAV_ODID_CLASS_EU_CLASS_1 = 2,
2705 #[doc = "The class for the UA, according to the EU specification, is Class 2."]
2706 MAV_ODID_CLASS_EU_CLASS_2 = 3,
2707 #[doc = "The class for the UA, according to the EU specification, is Class 3."]
2708 MAV_ODID_CLASS_EU_CLASS_3 = 4,
2709 #[doc = "The class for the UA, according to the EU specification, is Class 4."]
2710 MAV_ODID_CLASS_EU_CLASS_4 = 5,
2711 #[doc = "The class for the UA, according to the EU specification, is Class 5."]
2712 MAV_ODID_CLASS_EU_CLASS_5 = 6,
2713 #[doc = "The class for the UA, according to the EU specification, is Class 6."]
2714 MAV_ODID_CLASS_EU_CLASS_6 = 7,
2715}
2716impl MavOdidClassEu {
2717 pub const DEFAULT: Self = Self::MAV_ODID_CLASS_EU_UNDECLARED;
2718}
2719impl Default for MavOdidClassEu {
2720 fn default() -> Self {
2721 Self::DEFAULT
2722 }
2723}
2724#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2725#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2726#[cfg_attr(feature = "serde", serde(tag = "type"))]
2727#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2728#[repr(u32)]
2729pub enum MavOdidClassificationType {
2730 #[doc = "The classification type for the UA is undeclared."]
2731 MAV_ODID_CLASSIFICATION_TYPE_UNDECLARED = 0,
2732 #[doc = "The classification type for the UA follows EU (European Union) specifications."]
2733 MAV_ODID_CLASSIFICATION_TYPE_EU = 1,
2734}
2735impl MavOdidClassificationType {
2736 pub const DEFAULT: Self = Self::MAV_ODID_CLASSIFICATION_TYPE_UNDECLARED;
2737}
2738impl Default for MavOdidClassificationType {
2739 fn default() -> Self {
2740 Self::DEFAULT
2741 }
2742}
2743#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2744#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2745#[cfg_attr(feature = "serde", serde(tag = "type"))]
2746#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2747#[repr(u32)]
2748pub enum MavOdidDescType {
2749 #[doc = "Optional free-form text description of the purpose of the flight."]
2750 MAV_ODID_DESC_TYPE_TEXT = 0,
2751 #[doc = "Optional additional clarification when status == MAV_ODID_STATUS_EMERGENCY."]
2752 MAV_ODID_DESC_TYPE_EMERGENCY = 1,
2753 #[doc = "Optional additional clarification when status != MAV_ODID_STATUS_EMERGENCY."]
2754 MAV_ODID_DESC_TYPE_EXTENDED_STATUS = 2,
2755}
2756impl MavOdidDescType {
2757 pub const DEFAULT: Self = Self::MAV_ODID_DESC_TYPE_TEXT;
2758}
2759impl Default for MavOdidDescType {
2760 fn default() -> Self {
2761 Self::DEFAULT
2762 }
2763}
2764#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2765#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2766#[cfg_attr(feature = "serde", serde(tag = "type"))]
2767#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2768#[repr(u32)]
2769pub enum MavOdidHeightRef {
2770 #[doc = "The height field is relative to the take-off location."]
2771 MAV_ODID_HEIGHT_REF_OVER_TAKEOFF = 0,
2772 #[doc = "The height field is relative to ground."]
2773 MAV_ODID_HEIGHT_REF_OVER_GROUND = 1,
2774}
2775impl MavOdidHeightRef {
2776 pub const DEFAULT: Self = Self::MAV_ODID_HEIGHT_REF_OVER_TAKEOFF;
2777}
2778impl Default for MavOdidHeightRef {
2779 fn default() -> Self {
2780 Self::DEFAULT
2781 }
2782}
2783#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2784#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2785#[cfg_attr(feature = "serde", serde(tag = "type"))]
2786#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2787#[repr(u32)]
2788pub enum MavOdidHorAcc {
2789 #[doc = "The horizontal accuracy is unknown."]
2790 MAV_ODID_HOR_ACC_UNKNOWN = 0,
2791 #[doc = "The horizontal accuracy is smaller than 10 Nautical Miles. 18.52 km."]
2792 MAV_ODID_HOR_ACC_10NM = 1,
2793 #[doc = "The horizontal accuracy is smaller than 4 Nautical Miles. 7.408 km."]
2794 MAV_ODID_HOR_ACC_4NM = 2,
2795 #[doc = "The horizontal accuracy is smaller than 2 Nautical Miles. 3.704 km."]
2796 MAV_ODID_HOR_ACC_2NM = 3,
2797 #[doc = "The horizontal accuracy is smaller than 1 Nautical Miles. 1.852 km."]
2798 MAV_ODID_HOR_ACC_1NM = 4,
2799 #[doc = "The horizontal accuracy is smaller than 0.5 Nautical Miles. 926 m."]
2800 MAV_ODID_HOR_ACC_0_5NM = 5,
2801 #[doc = "The horizontal accuracy is smaller than 0.3 Nautical Miles. 555.6 m."]
2802 MAV_ODID_HOR_ACC_0_3NM = 6,
2803 #[doc = "The horizontal accuracy is smaller than 0.1 Nautical Miles. 185.2 m."]
2804 MAV_ODID_HOR_ACC_0_1NM = 7,
2805 #[doc = "The horizontal accuracy is smaller than 0.05 Nautical Miles. 92.6 m."]
2806 MAV_ODID_HOR_ACC_0_05NM = 8,
2807 #[doc = "The horizontal accuracy is smaller than 30 meter."]
2808 MAV_ODID_HOR_ACC_30_METER = 9,
2809 #[doc = "The horizontal accuracy is smaller than 10 meter."]
2810 MAV_ODID_HOR_ACC_10_METER = 10,
2811 #[doc = "The horizontal accuracy is smaller than 3 meter."]
2812 MAV_ODID_HOR_ACC_3_METER = 11,
2813 #[doc = "The horizontal accuracy is smaller than 1 meter."]
2814 MAV_ODID_HOR_ACC_1_METER = 12,
2815}
2816impl MavOdidHorAcc {
2817 pub const DEFAULT: Self = Self::MAV_ODID_HOR_ACC_UNKNOWN;
2818}
2819impl Default for MavOdidHorAcc {
2820 fn default() -> Self {
2821 Self::DEFAULT
2822 }
2823}
2824#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2825#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2826#[cfg_attr(feature = "serde", serde(tag = "type"))]
2827#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2828#[repr(u32)]
2829pub enum MavOdidIdType {
2830 #[doc = "No type defined."]
2831 MAV_ODID_ID_TYPE_NONE = 0,
2832 #[doc = "Manufacturer Serial Number (ANSI/CTA-2063 format)."]
2833 MAV_ODID_ID_TYPE_SERIAL_NUMBER = 1,
2834 #[doc = "CAA (Civil Aviation Authority) registered ID. Format: [ICAO Country Code].[CAA Assigned ID]."]
2835 MAV_ODID_ID_TYPE_CAA_REGISTRATION_ID = 2,
2836 #[doc = "UTM (Unmanned Traffic Management) assigned UUID (RFC4122)."]
2837 MAV_ODID_ID_TYPE_UTM_ASSIGNED_UUID = 3,
2838 #[doc = "A 20 byte ID for a specific flight/session. The exact ID type is indicated by the first byte of uas_id and these type values are managed by ICAO."]
2839 MAV_ODID_ID_TYPE_SPECIFIC_SESSION_ID = 4,
2840}
2841impl MavOdidIdType {
2842 pub const DEFAULT: Self = Self::MAV_ODID_ID_TYPE_NONE;
2843}
2844impl Default for MavOdidIdType {
2845 fn default() -> Self {
2846 Self::DEFAULT
2847 }
2848}
2849#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2850#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2851#[cfg_attr(feature = "serde", serde(tag = "type"))]
2852#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2853#[repr(u32)]
2854pub enum MavOdidOperatorIdType {
2855 #[doc = "CAA (Civil Aviation Authority) registered operator ID."]
2856 MAV_ODID_OPERATOR_ID_TYPE_CAA = 0,
2857}
2858impl MavOdidOperatorIdType {
2859 pub const DEFAULT: Self = Self::MAV_ODID_OPERATOR_ID_TYPE_CAA;
2860}
2861impl Default for MavOdidOperatorIdType {
2862 fn default() -> Self {
2863 Self::DEFAULT
2864 }
2865}
2866#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2867#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2868#[cfg_attr(feature = "serde", serde(tag = "type"))]
2869#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2870#[repr(u32)]
2871pub enum MavOdidOperatorLocationType {
2872 #[doc = "The location/altitude of the operator is the same as the take-off location."]
2873 MAV_ODID_OPERATOR_LOCATION_TYPE_TAKEOFF = 0,
2874 #[doc = "The location/altitude of the operator is dynamic. E.g. based on live GNSS data."]
2875 MAV_ODID_OPERATOR_LOCATION_TYPE_LIVE_GNSS = 1,
2876 #[doc = "The location/altitude of the operator are fixed values."]
2877 MAV_ODID_OPERATOR_LOCATION_TYPE_FIXED = 2,
2878}
2879impl MavOdidOperatorLocationType {
2880 pub const DEFAULT: Self = Self::MAV_ODID_OPERATOR_LOCATION_TYPE_TAKEOFF;
2881}
2882impl Default for MavOdidOperatorLocationType {
2883 fn default() -> Self {
2884 Self::DEFAULT
2885 }
2886}
2887#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2888#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2889#[cfg_attr(feature = "serde", serde(tag = "type"))]
2890#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2891#[repr(u32)]
2892pub enum MavOdidSpeedAcc {
2893 #[doc = "The speed accuracy is unknown."]
2894 MAV_ODID_SPEED_ACC_UNKNOWN = 0,
2895 #[doc = "The speed accuracy is smaller than 10 meters per second."]
2896 MAV_ODID_SPEED_ACC_10_METERS_PER_SECOND = 1,
2897 #[doc = "The speed accuracy is smaller than 3 meters per second."]
2898 MAV_ODID_SPEED_ACC_3_METERS_PER_SECOND = 2,
2899 #[doc = "The speed accuracy is smaller than 1 meters per second."]
2900 MAV_ODID_SPEED_ACC_1_METERS_PER_SECOND = 3,
2901 #[doc = "The speed accuracy is smaller than 0.3 meters per second."]
2902 MAV_ODID_SPEED_ACC_0_3_METERS_PER_SECOND = 4,
2903}
2904impl MavOdidSpeedAcc {
2905 pub const DEFAULT: Self = Self::MAV_ODID_SPEED_ACC_UNKNOWN;
2906}
2907impl Default for MavOdidSpeedAcc {
2908 fn default() -> Self {
2909 Self::DEFAULT
2910 }
2911}
2912#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2913#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2914#[cfg_attr(feature = "serde", serde(tag = "type"))]
2915#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2916#[repr(u32)]
2917pub enum MavOdidStatus {
2918 #[doc = "The status of the (UA) Unmanned Aircraft is undefined."]
2919 MAV_ODID_STATUS_UNDECLARED = 0,
2920 #[doc = "The UA is on the ground."]
2921 MAV_ODID_STATUS_GROUND = 1,
2922 #[doc = "The UA is in the air."]
2923 MAV_ODID_STATUS_AIRBORNE = 2,
2924 #[doc = "The UA is having an emergency."]
2925 MAV_ODID_STATUS_EMERGENCY = 3,
2926 #[doc = "The remote ID system is failing or unreliable in some way."]
2927 MAV_ODID_STATUS_REMOTE_ID_SYSTEM_FAILURE = 4,
2928}
2929impl MavOdidStatus {
2930 pub const DEFAULT: Self = Self::MAV_ODID_STATUS_UNDECLARED;
2931}
2932impl Default for MavOdidStatus {
2933 fn default() -> Self {
2934 Self::DEFAULT
2935 }
2936}
2937#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2938#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2939#[cfg_attr(feature = "serde", serde(tag = "type"))]
2940#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2941#[repr(u32)]
2942pub enum MavOdidTimeAcc {
2943 #[doc = "The timestamp accuracy is unknown."]
2944 MAV_ODID_TIME_ACC_UNKNOWN = 0,
2945 #[doc = "The timestamp accuracy is smaller than or equal to 0.1 second."]
2946 MAV_ODID_TIME_ACC_0_1_SECOND = 1,
2947 #[doc = "The timestamp accuracy is smaller than or equal to 0.2 second."]
2948 MAV_ODID_TIME_ACC_0_2_SECOND = 2,
2949 #[doc = "The timestamp accuracy is smaller than or equal to 0.3 second."]
2950 MAV_ODID_TIME_ACC_0_3_SECOND = 3,
2951 #[doc = "The timestamp accuracy is smaller than or equal to 0.4 second."]
2952 MAV_ODID_TIME_ACC_0_4_SECOND = 4,
2953 #[doc = "The timestamp accuracy is smaller than or equal to 0.5 second."]
2954 MAV_ODID_TIME_ACC_0_5_SECOND = 5,
2955 #[doc = "The timestamp accuracy is smaller than or equal to 0.6 second."]
2956 MAV_ODID_TIME_ACC_0_6_SECOND = 6,
2957 #[doc = "The timestamp accuracy is smaller than or equal to 0.7 second."]
2958 MAV_ODID_TIME_ACC_0_7_SECOND = 7,
2959 #[doc = "The timestamp accuracy is smaller than or equal to 0.8 second."]
2960 MAV_ODID_TIME_ACC_0_8_SECOND = 8,
2961 #[doc = "The timestamp accuracy is smaller than or equal to 0.9 second."]
2962 MAV_ODID_TIME_ACC_0_9_SECOND = 9,
2963 #[doc = "The timestamp accuracy is smaller than or equal to 1.0 second."]
2964 MAV_ODID_TIME_ACC_1_0_SECOND = 10,
2965 #[doc = "The timestamp accuracy is smaller than or equal to 1.1 second."]
2966 MAV_ODID_TIME_ACC_1_1_SECOND = 11,
2967 #[doc = "The timestamp accuracy is smaller than or equal to 1.2 second."]
2968 MAV_ODID_TIME_ACC_1_2_SECOND = 12,
2969 #[doc = "The timestamp accuracy is smaller than or equal to 1.3 second."]
2970 MAV_ODID_TIME_ACC_1_3_SECOND = 13,
2971 #[doc = "The timestamp accuracy is smaller than or equal to 1.4 second."]
2972 MAV_ODID_TIME_ACC_1_4_SECOND = 14,
2973 #[doc = "The timestamp accuracy is smaller than or equal to 1.5 second."]
2974 MAV_ODID_TIME_ACC_1_5_SECOND = 15,
2975}
2976impl MavOdidTimeAcc {
2977 pub const DEFAULT: Self = Self::MAV_ODID_TIME_ACC_UNKNOWN;
2978}
2979impl Default for MavOdidTimeAcc {
2980 fn default() -> Self {
2981 Self::DEFAULT
2982 }
2983}
2984#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2985#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2986#[cfg_attr(feature = "serde", serde(tag = "type"))]
2987#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2988#[repr(u32)]
2989pub enum MavOdidUaType {
2990 #[doc = "No UA (Unmanned Aircraft) type defined."]
2991 MAV_ODID_UA_TYPE_NONE = 0,
2992 #[doc = "Aeroplane/Airplane. Fixed wing."]
2993 MAV_ODID_UA_TYPE_AEROPLANE = 1,
2994 #[doc = "Helicopter or multirotor."]
2995 MAV_ODID_UA_TYPE_HELICOPTER_OR_MULTIROTOR = 2,
2996 #[doc = "Gyroplane."]
2997 MAV_ODID_UA_TYPE_GYROPLANE = 3,
2998 #[doc = "VTOL (Vertical Take-Off and Landing). Fixed wing aircraft that can take off vertically."]
2999 MAV_ODID_UA_TYPE_HYBRID_LIFT = 4,
3000 #[doc = "Ornithopter."]
3001 MAV_ODID_UA_TYPE_ORNITHOPTER = 5,
3002 #[doc = "Glider."]
3003 MAV_ODID_UA_TYPE_GLIDER = 6,
3004 #[doc = "Kite."]
3005 MAV_ODID_UA_TYPE_KITE = 7,
3006 #[doc = "Free Balloon."]
3007 MAV_ODID_UA_TYPE_FREE_BALLOON = 8,
3008 #[doc = "Captive Balloon."]
3009 MAV_ODID_UA_TYPE_CAPTIVE_BALLOON = 9,
3010 #[doc = "Airship. E.g. a blimp."]
3011 MAV_ODID_UA_TYPE_AIRSHIP = 10,
3012 #[doc = "Free Fall/Parachute (unpowered)."]
3013 MAV_ODID_UA_TYPE_FREE_FALL_PARACHUTE = 11,
3014 #[doc = "Rocket."]
3015 MAV_ODID_UA_TYPE_ROCKET = 12,
3016 #[doc = "Tethered powered aircraft."]
3017 MAV_ODID_UA_TYPE_TETHERED_POWERED_AIRCRAFT = 13,
3018 #[doc = "Ground Obstacle."]
3019 MAV_ODID_UA_TYPE_GROUND_OBSTACLE = 14,
3020 #[doc = "Other type of aircraft not listed earlier."]
3021 MAV_ODID_UA_TYPE_OTHER = 15,
3022}
3023impl MavOdidUaType {
3024 pub const DEFAULT: Self = Self::MAV_ODID_UA_TYPE_NONE;
3025}
3026impl Default for MavOdidUaType {
3027 fn default() -> Self {
3028 Self::DEFAULT
3029 }
3030}
3031#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3032#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3033#[cfg_attr(feature = "serde", serde(tag = "type"))]
3034#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3035#[repr(u32)]
3036pub enum MavOdidVerAcc {
3037 #[doc = "The vertical accuracy is unknown."]
3038 MAV_ODID_VER_ACC_UNKNOWN = 0,
3039 #[doc = "The vertical accuracy is smaller than 150 meter."]
3040 MAV_ODID_VER_ACC_150_METER = 1,
3041 #[doc = "The vertical accuracy is smaller than 45 meter."]
3042 MAV_ODID_VER_ACC_45_METER = 2,
3043 #[doc = "The vertical accuracy is smaller than 25 meter."]
3044 MAV_ODID_VER_ACC_25_METER = 3,
3045 #[doc = "The vertical accuracy is smaller than 10 meter."]
3046 MAV_ODID_VER_ACC_10_METER = 4,
3047 #[doc = "The vertical accuracy is smaller than 3 meter."]
3048 MAV_ODID_VER_ACC_3_METER = 5,
3049 #[doc = "The vertical accuracy is smaller than 1 meter."]
3050 MAV_ODID_VER_ACC_1_METER = 6,
3051}
3052impl MavOdidVerAcc {
3053 pub const DEFAULT: Self = Self::MAV_ODID_VER_ACC_UNKNOWN;
3054}
3055impl Default for MavOdidVerAcc {
3056 fn default() -> Self {
3057 Self::DEFAULT
3058 }
3059}
3060#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3061#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3062#[cfg_attr(feature = "serde", serde(tag = "type"))]
3063#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3064#[repr(u32)]
3065#[doc = "Specifies the datatype of a MAVLink extended parameter."]
3066pub enum MavParamExtType {
3067 #[doc = "8-bit unsigned integer"]
3068 MAV_PARAM_EXT_TYPE_UINT8 = 1,
3069 #[doc = "8-bit signed integer"]
3070 MAV_PARAM_EXT_TYPE_INT8 = 2,
3071 #[doc = "16-bit unsigned integer"]
3072 MAV_PARAM_EXT_TYPE_UINT16 = 3,
3073 #[doc = "16-bit signed integer"]
3074 MAV_PARAM_EXT_TYPE_INT16 = 4,
3075 #[doc = "32-bit unsigned integer"]
3076 MAV_PARAM_EXT_TYPE_UINT32 = 5,
3077 #[doc = "32-bit signed integer"]
3078 MAV_PARAM_EXT_TYPE_INT32 = 6,
3079 #[doc = "64-bit unsigned integer"]
3080 MAV_PARAM_EXT_TYPE_UINT64 = 7,
3081 #[doc = "64-bit signed integer"]
3082 MAV_PARAM_EXT_TYPE_INT64 = 8,
3083 #[doc = "32-bit floating-point"]
3084 MAV_PARAM_EXT_TYPE_REAL32 = 9,
3085 #[doc = "64-bit floating-point"]
3086 MAV_PARAM_EXT_TYPE_REAL64 = 10,
3087 #[doc = "Custom Type"]
3088 MAV_PARAM_EXT_TYPE_CUSTOM = 11,
3089}
3090impl MavParamExtType {
3091 pub const DEFAULT: Self = Self::MAV_PARAM_EXT_TYPE_UINT8;
3092}
3093impl Default for MavParamExtType {
3094 fn default() -> Self {
3095 Self::DEFAULT
3096 }
3097}
3098#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3099#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3100#[cfg_attr(feature = "serde", serde(tag = "type"))]
3101#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3102#[repr(u32)]
3103#[doc = "Specifies the datatype of a MAVLink parameter."]
3104pub enum MavParamType {
3105 #[doc = "8-bit unsigned integer"]
3106 MAV_PARAM_TYPE_UINT8 = 1,
3107 #[doc = "8-bit signed integer"]
3108 MAV_PARAM_TYPE_INT8 = 2,
3109 #[doc = "16-bit unsigned integer"]
3110 MAV_PARAM_TYPE_UINT16 = 3,
3111 #[doc = "16-bit signed integer"]
3112 MAV_PARAM_TYPE_INT16 = 4,
3113 #[doc = "32-bit unsigned integer"]
3114 MAV_PARAM_TYPE_UINT32 = 5,
3115 #[doc = "32-bit signed integer"]
3116 MAV_PARAM_TYPE_INT32 = 6,
3117 #[doc = "64-bit unsigned integer"]
3118 MAV_PARAM_TYPE_UINT64 = 7,
3119 #[doc = "64-bit signed integer"]
3120 MAV_PARAM_TYPE_INT64 = 8,
3121 #[doc = "32-bit floating-point"]
3122 MAV_PARAM_TYPE_REAL32 = 9,
3123 #[doc = "64-bit floating-point"]
3124 MAV_PARAM_TYPE_REAL64 = 10,
3125}
3126impl MavParamType {
3127 pub const DEFAULT: Self = Self::MAV_PARAM_TYPE_UINT8;
3128}
3129impl Default for MavParamType {
3130 fn default() -> Self {
3131 Self::DEFAULT
3132 }
3133}
3134bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Power supply status flags (bitmask)"] pub struct MavPowerStatus : u16 { # [doc = "main brick power supply valid"] const MAV_POWER_STATUS_BRICK_VALID = 1 ; # [doc = "main servo power supply valid for FMU"] const MAV_POWER_STATUS_SERVO_VALID = 2 ; # [doc = "USB power is connected"] const MAV_POWER_STATUS_USB_CONNECTED = 4 ; # [doc = "peripheral supply is in over-current state"] const MAV_POWER_STATUS_PERIPH_OVERCURRENT = 8 ; # [doc = "hi-power peripheral supply is in over-current state"] const MAV_POWER_STATUS_PERIPH_HIPOWER_OVERCURRENT = 16 ; # [doc = "Power status has changed since boot"] const MAV_POWER_STATUS_CHANGED = 32 ; } }
3135impl MavPowerStatus {
3136 pub const DEFAULT: Self = Self::MAV_POWER_STATUS_BRICK_VALID;
3137}
3138impl Default for MavPowerStatus {
3139 fn default() -> Self {
3140 Self::DEFAULT
3141 }
3142}
3143bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Bitmask of (optional) autopilot capabilities (64 bit). If a bit is set, the autopilot supports this capability."] pub struct MavProtocolCapability : u64 { # [doc = "Autopilot supports the MISSION_ITEM float message type. Note that MISSION_ITEM is deprecated, and autopilots should use MISSION_INT instead."] const MAV_PROTOCOL_CAPABILITY_MISSION_FLOAT = 1 ; # [deprecated = " See `MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST` (Deprecated since 2022-03)"] # [doc = "Autopilot supports the new param float message type."] const MAV_PROTOCOL_CAPABILITY_PARAM_FLOAT = 2 ; # [doc = "Autopilot supports MISSION_ITEM_INT scaled integer message type. Note that this flag must always be set if missions are supported, because missions must always use MISSION_ITEM_INT (rather than MISSION_ITEM, which is deprecated)."] const MAV_PROTOCOL_CAPABILITY_MISSION_INT = 4 ; # [doc = "Autopilot supports COMMAND_INT scaled integer message type."] const MAV_PROTOCOL_CAPABILITY_COMMAND_INT = 8 ; # [doc = "Parameter protocol uses byte-wise encoding of parameter values into param_value (float) fields: <https://mavlink.io/en/services/parameter.html#parameter-encoding>. Note that either this flag or MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST should be set if the parameter protocol is supported."] const MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_BYTEWISE = 16 ; # [doc = "Autopilot supports the File Transfer Protocol v1: <https://mavlink.io/en/services/ftp.html>."] const MAV_PROTOCOL_CAPABILITY_FTP = 32 ; # [doc = "Autopilot supports commanding attitude offboard."] const MAV_PROTOCOL_CAPABILITY_SET_ATTITUDE_TARGET = 64 ; # [doc = "Autopilot supports commanding position and velocity targets in local NED frame."] const MAV_PROTOCOL_CAPABILITY_SET_POSITION_TARGET_LOCAL_NED = 128 ; # [doc = "Autopilot supports commanding position and velocity targets in global scaled integers."] const MAV_PROTOCOL_CAPABILITY_SET_POSITION_TARGET_GLOBAL_INT = 256 ; # [doc = "Autopilot supports terrain protocol / data handling."] const MAV_PROTOCOL_CAPABILITY_TERRAIN = 512 ; # [doc = "Reserved for future use."] const MAV_PROTOCOL_CAPABILITY_RESERVED3 = 1024 ; # [doc = "Autopilot supports the MAV_CMD_DO_FLIGHTTERMINATION command (flight termination)."] const MAV_PROTOCOL_CAPABILITY_FLIGHT_TERMINATION = 2048 ; # [doc = "Autopilot supports onboard compass calibration."] const MAV_PROTOCOL_CAPABILITY_COMPASS_CALIBRATION = 4096 ; # [doc = "Autopilot supports MAVLink version 2."] const MAV_PROTOCOL_CAPABILITY_MAVLINK2 = 8192 ; # [doc = "Autopilot supports mission fence protocol."] const MAV_PROTOCOL_CAPABILITY_MISSION_FENCE = 16384 ; # [doc = "Autopilot supports mission rally point protocol."] const MAV_PROTOCOL_CAPABILITY_MISSION_RALLY = 32768 ; # [doc = "Reserved for future use."] const MAV_PROTOCOL_CAPABILITY_RESERVED2 = 65536 ; # [doc = "Parameter protocol uses C-cast of parameter values to set the param_value (float) fields: <https://mavlink.io/en/services/parameter.html#parameter-encoding>. Note that either this flag or MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_BYTEWISE should be set if the parameter protocol is supported."] const MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST = 131072 ; # [doc = "This component implements/is a gimbal manager. This means the GIMBAL_MANAGER_INFORMATION, and other messages can be requested."] const MAV_PROTOCOL_CAPABILITY_COMPONENT_IMPLEMENTS_GIMBAL_MANAGER = 262144 ; # [doc = "Component supports locking control to a particular GCS independent of its system (via MAV_CMD_REQUEST_OPERATOR_CONTROL)."] const MAV_PROTOCOL_CAPABILITY_COMPONENT_ACCEPTS_GCS_CONTROL = 524288 ; } }
3144impl MavProtocolCapability {
3145 pub const DEFAULT: Self = Self::MAV_PROTOCOL_CAPABILITY_MISSION_FLOAT;
3146}
3147impl Default for MavProtocolCapability {
3148 fn default() -> Self {
3149 Self::DEFAULT
3150 }
3151}
3152#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3153#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3154#[cfg_attr(feature = "serde", serde(tag = "type"))]
3155#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3156#[repr(u32)]
3157#[doc = "Result from a MAVLink command (MAV_CMD)"]
3158pub enum MavResult {
3159 #[doc = "Command is valid (is supported and has valid parameters), and was executed."]
3160 MAV_RESULT_ACCEPTED = 0,
3161 #[doc = "Command is valid, but cannot be executed at this time. This is used to indicate a problem that should be fixed just by waiting (e.g. a state machine is busy, can't arm because have not got GPS lock, etc.). Retrying later should work."]
3162 MAV_RESULT_TEMPORARILY_REJECTED = 1,
3163 #[doc = "Command is invalid (is supported but has invalid parameters). Retrying same command and parameters will not work."]
3164 MAV_RESULT_DENIED = 2,
3165 #[doc = "Command is not supported (unknown)."]
3166 MAV_RESULT_UNSUPPORTED = 3,
3167 #[doc = "Command is valid, but execution has failed. This is used to indicate any non-temporary or unexpected problem, i.e. any problem that must be fixed before the command can succeed/be retried. For example, attempting to write a file when out of memory, attempting to arm when sensors are not calibrated, etc."]
3168 MAV_RESULT_FAILED = 4,
3169 #[doc = "Command is valid and is being executed. This will be followed by further progress updates, i.e. the component may send further COMMAND_ACK messages with result MAV_RESULT_IN_PROGRESS (at a rate decided by the implementation), and must terminate by sending a COMMAND_ACK message with final result of the operation. The COMMAND_ACK.progress field can be used to indicate the progress of the operation."]
3170 MAV_RESULT_IN_PROGRESS = 5,
3171 #[doc = "Command has been cancelled (as a result of receiving a COMMAND_CANCEL message)."]
3172 MAV_RESULT_CANCELLED = 6,
3173 #[doc = "Command is only accepted when sent as a COMMAND_LONG."]
3174 MAV_RESULT_COMMAND_LONG_ONLY = 7,
3175 #[doc = "Command is only accepted when sent as a COMMAND_INT."]
3176 MAV_RESULT_COMMAND_INT_ONLY = 8,
3177 #[doc = "Command is invalid because a frame is required and the specified frame is not supported."]
3178 MAV_RESULT_COMMAND_UNSUPPORTED_MAV_FRAME = 9,
3179}
3180impl MavResult {
3181 pub const DEFAULT: Self = Self::MAV_RESULT_ACCEPTED;
3182}
3183impl Default for MavResult {
3184 fn default() -> Self {
3185 Self::DEFAULT
3186 }
3187}
3188#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3189#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3190#[cfg_attr(feature = "serde", serde(tag = "type"))]
3191#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3192#[repr(u32)]
3193#[deprecated = " See `MAV_CMD_DO_SET_ROI_*` (Deprecated since 2018-01)"]
3194#[doc = "The ROI (region of interest) for the vehicle. This can be be used by the vehicle for camera/vehicle attitude alignment (see MAV_CMD_NAV_ROI)."]
3195pub enum MavRoi {
3196 #[doc = "No region of interest."]
3197 MAV_ROI_NONE = 0,
3198 #[doc = "Point toward next waypoint, with optional pitch/roll/yaw offset."]
3199 MAV_ROI_WPNEXT = 1,
3200 #[doc = "Point toward given waypoint."]
3201 MAV_ROI_WPINDEX = 2,
3202 #[doc = "Point toward fixed location."]
3203 MAV_ROI_LOCATION = 3,
3204 #[doc = "Point toward of given id."]
3205 MAV_ROI_TARGET = 4,
3206}
3207impl MavRoi {
3208 pub const DEFAULT: Self = Self::MAV_ROI_NONE;
3209}
3210impl Default for MavRoi {
3211 fn default() -> Self {
3212 Self::DEFAULT
3213 }
3214}
3215#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3216#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3217#[cfg_attr(feature = "serde", serde(tag = "type"))]
3218#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3219#[repr(u32)]
3220#[doc = "Enumeration of sensor orientation, according to its rotations"]
3221pub enum MavSensorOrientation {
3222 #[doc = "Roll: 0, Pitch: 0, Yaw: 0"]
3223 MAV_SENSOR_ROTATION_NONE = 0,
3224 #[doc = "Roll: 0, Pitch: 0, Yaw: 45"]
3225 MAV_SENSOR_ROTATION_YAW_45 = 1,
3226 #[doc = "Roll: 0, Pitch: 0, Yaw: 90"]
3227 MAV_SENSOR_ROTATION_YAW_90 = 2,
3228 #[doc = "Roll: 0, Pitch: 0, Yaw: 135"]
3229 MAV_SENSOR_ROTATION_YAW_135 = 3,
3230 #[doc = "Roll: 0, Pitch: 0, Yaw: 180"]
3231 MAV_SENSOR_ROTATION_YAW_180 = 4,
3232 #[doc = "Roll: 0, Pitch: 0, Yaw: 225"]
3233 MAV_SENSOR_ROTATION_YAW_225 = 5,
3234 #[doc = "Roll: 0, Pitch: 0, Yaw: 270"]
3235 MAV_SENSOR_ROTATION_YAW_270 = 6,
3236 #[doc = "Roll: 0, Pitch: 0, Yaw: 315"]
3237 MAV_SENSOR_ROTATION_YAW_315 = 7,
3238 #[doc = "Roll: 180, Pitch: 0, Yaw: 0"]
3239 MAV_SENSOR_ROTATION_ROLL_180 = 8,
3240 #[doc = "Roll: 180, Pitch: 0, Yaw: 45"]
3241 MAV_SENSOR_ROTATION_ROLL_180_YAW_45 = 9,
3242 #[doc = "Roll: 180, Pitch: 0, Yaw: 90"]
3243 MAV_SENSOR_ROTATION_ROLL_180_YAW_90 = 10,
3244 #[doc = "Roll: 180, Pitch: 0, Yaw: 135"]
3245 MAV_SENSOR_ROTATION_ROLL_180_YAW_135 = 11,
3246 #[doc = "Roll: 0, Pitch: 180, Yaw: 0"]
3247 MAV_SENSOR_ROTATION_PITCH_180 = 12,
3248 #[doc = "Roll: 180, Pitch: 0, Yaw: 225"]
3249 MAV_SENSOR_ROTATION_ROLL_180_YAW_225 = 13,
3250 #[doc = "Roll: 180, Pitch: 0, Yaw: 270"]
3251 MAV_SENSOR_ROTATION_ROLL_180_YAW_270 = 14,
3252 #[doc = "Roll: 180, Pitch: 0, Yaw: 315"]
3253 MAV_SENSOR_ROTATION_ROLL_180_YAW_315 = 15,
3254 #[doc = "Roll: 90, Pitch: 0, Yaw: 0"]
3255 MAV_SENSOR_ROTATION_ROLL_90 = 16,
3256 #[doc = "Roll: 90, Pitch: 0, Yaw: 45"]
3257 MAV_SENSOR_ROTATION_ROLL_90_YAW_45 = 17,
3258 #[doc = "Roll: 90, Pitch: 0, Yaw: 90"]
3259 MAV_SENSOR_ROTATION_ROLL_90_YAW_90 = 18,
3260 #[doc = "Roll: 90, Pitch: 0, Yaw: 135"]
3261 MAV_SENSOR_ROTATION_ROLL_90_YAW_135 = 19,
3262 #[doc = "Roll: 270, Pitch: 0, Yaw: 0"]
3263 MAV_SENSOR_ROTATION_ROLL_270 = 20,
3264 #[doc = "Roll: 270, Pitch: 0, Yaw: 45"]
3265 MAV_SENSOR_ROTATION_ROLL_270_YAW_45 = 21,
3266 #[doc = "Roll: 270, Pitch: 0, Yaw: 90"]
3267 MAV_SENSOR_ROTATION_ROLL_270_YAW_90 = 22,
3268 #[doc = "Roll: 270, Pitch: 0, Yaw: 135"]
3269 MAV_SENSOR_ROTATION_ROLL_270_YAW_135 = 23,
3270 #[doc = "Roll: 0, Pitch: 90, Yaw: 0"]
3271 MAV_SENSOR_ROTATION_PITCH_90 = 24,
3272 #[doc = "Roll: 0, Pitch: 270, Yaw: 0"]
3273 MAV_SENSOR_ROTATION_PITCH_270 = 25,
3274 #[doc = "Roll: 0, Pitch: 180, Yaw: 90"]
3275 MAV_SENSOR_ROTATION_PITCH_180_YAW_90 = 26,
3276 #[doc = "Roll: 0, Pitch: 180, Yaw: 270"]
3277 MAV_SENSOR_ROTATION_PITCH_180_YAW_270 = 27,
3278 #[doc = "Roll: 90, Pitch: 90, Yaw: 0"]
3279 MAV_SENSOR_ROTATION_ROLL_90_PITCH_90 = 28,
3280 #[doc = "Roll: 180, Pitch: 90, Yaw: 0"]
3281 MAV_SENSOR_ROTATION_ROLL_180_PITCH_90 = 29,
3282 #[doc = "Roll: 270, Pitch: 90, Yaw: 0"]
3283 MAV_SENSOR_ROTATION_ROLL_270_PITCH_90 = 30,
3284 #[doc = "Roll: 90, Pitch: 180, Yaw: 0"]
3285 MAV_SENSOR_ROTATION_ROLL_90_PITCH_180 = 31,
3286 #[doc = "Roll: 270, Pitch: 180, Yaw: 0"]
3287 MAV_SENSOR_ROTATION_ROLL_270_PITCH_180 = 32,
3288 #[doc = "Roll: 90, Pitch: 270, Yaw: 0"]
3289 MAV_SENSOR_ROTATION_ROLL_90_PITCH_270 = 33,
3290 #[doc = "Roll: 180, Pitch: 270, Yaw: 0"]
3291 MAV_SENSOR_ROTATION_ROLL_180_PITCH_270 = 34,
3292 #[doc = "Roll: 270, Pitch: 270, Yaw: 0"]
3293 MAV_SENSOR_ROTATION_ROLL_270_PITCH_270 = 35,
3294 #[doc = "Roll: 90, Pitch: 180, Yaw: 90"]
3295 MAV_SENSOR_ROTATION_ROLL_90_PITCH_180_YAW_90 = 36,
3296 #[doc = "Roll: 90, Pitch: 0, Yaw: 270"]
3297 MAV_SENSOR_ROTATION_ROLL_90_YAW_270 = 37,
3298 #[doc = "Roll: 90, Pitch: 68, Yaw: 293"]
3299 MAV_SENSOR_ROTATION_ROLL_90_PITCH_68_YAW_293 = 38,
3300 #[doc = "Pitch: 315"]
3301 MAV_SENSOR_ROTATION_PITCH_315 = 39,
3302 #[doc = "Roll: 90, Pitch: 315"]
3303 MAV_SENSOR_ROTATION_ROLL_90_PITCH_315 = 40,
3304 #[doc = "Custom orientation"]
3305 MAV_SENSOR_ROTATION_CUSTOM = 100,
3306}
3307impl MavSensorOrientation {
3308 pub const DEFAULT: Self = Self::MAV_SENSOR_ROTATION_NONE;
3309}
3310impl Default for MavSensorOrientation {
3311 fn default() -> Self {
3312 Self::DEFAULT
3313 }
3314}
3315#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3316#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3317#[cfg_attr(feature = "serde", serde(tag = "type"))]
3318#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3319#[repr(u32)]
3320#[doc = "Indicates the severity level, generally used for status messages to indicate their relative urgency. Based on RFC-5424 using expanded definitions at: <http://www.kiwisyslog.com/kb/info:-syslog-message-levels/>."]
3321pub enum MavSeverity {
3322 #[doc = "System is unusable. This is a \"panic\" condition."]
3323 MAV_SEVERITY_EMERGENCY = 0,
3324 #[doc = "Action should be taken immediately. Indicates error in non-critical systems."]
3325 MAV_SEVERITY_ALERT = 1,
3326 #[doc = "Action must be taken immediately. Indicates failure in a primary system."]
3327 MAV_SEVERITY_CRITICAL = 2,
3328 #[doc = "Indicates an error in secondary/redundant systems."]
3329 MAV_SEVERITY_ERROR = 3,
3330 #[doc = "Indicates about a possible future error if this is not resolved within a given timeframe. Example would be a low battery warning."]
3331 MAV_SEVERITY_WARNING = 4,
3332 #[doc = "An unusual event has occurred, though not an error condition. This should be investigated for the root cause."]
3333 MAV_SEVERITY_NOTICE = 5,
3334 #[doc = "Normal operational messages. Useful for logging. No action is required for these messages."]
3335 MAV_SEVERITY_INFO = 6,
3336 #[doc = "Useful non-operational messages that can assist in debugging. These should not occur during normal operation."]
3337 MAV_SEVERITY_DEBUG = 7,
3338}
3339impl MavSeverity {
3340 pub const DEFAULT: Self = Self::MAV_SEVERITY_EMERGENCY;
3341}
3342impl Default for MavSeverity {
3343 fn default() -> Self {
3344 Self::DEFAULT
3345 }
3346}
3347#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3348#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3349#[cfg_attr(feature = "serde", serde(tag = "type"))]
3350#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3351#[repr(u32)]
3352#[doc = "Standard modes with a well understood meaning across flight stacks and vehicle types. For example, most flight stack have the concept of a \"return\" or \"RTL\" mode that takes a vehicle to safety, even though the precise mechanics of this mode may differ. The modes supported by a flight stack can be queried using AVAILABLE_MODES and set using MAV_CMD_DO_SET_STANDARD_MODE. The current mode is streamed in CURRENT_MODE. See <https://mavlink.io/en/services/standard_modes.html>"]
3353pub enum MavStandardMode {
3354 #[doc = "Non standard mode. This may be used when reporting the mode if the current flight mode is not a standard mode."]
3355 MAV_STANDARD_MODE_NON_STANDARD = 0,
3356 #[doc = "Position mode (manual). Position-controlled and stabilized manual mode. When sticks are released vehicles return to their level-flight orientation and hold both position and altitude against wind and external forces. This mode can only be set by vehicles that can hold a fixed position. Multicopter (MC) vehicles actively brake and hold both position and altitude against wind and external forces. Hybrid MC/FW (\"VTOL\") vehicles first transition to multicopter mode (if needed) but otherwise behave in the same way as MC vehicles. Fixed-wing (FW) vehicles must not support this mode. Other vehicle types must not support this mode (this may be revisited through the PR process)."]
3357 MAV_STANDARD_MODE_POSITION_HOLD = 1,
3358 #[doc = "Orbit (manual). Position-controlled and stabilized manual mode. The vehicle circles around a fixed setpoint in the horizontal plane at a particular radius, altitude, and direction. Flight stacks may further allow manual control over the setpoint position, radius, direction, speed, and/or altitude of the circle, but this is not mandated. Flight stacks may support the [MAV_CMD_DO_ORBIT](<https://mavlink.io/en/messages/common.html#MAV_CMD_DO_ORBIT>) for changing the orbit parameters. MC and FW vehicles may support this mode. Hybrid MC/FW (\"VTOL\") vehicles may support this mode in MC/FW or both modes; if the mode is not supported by the current configuration the vehicle should transition to the supported configuration. Other vehicle types must not support this mode (this may be revisited through the PR process)."]
3359 MAV_STANDARD_MODE_ORBIT = 2,
3360 #[doc = "Cruise mode (manual). Position-controlled and stabilized manual mode. When sticks are released vehicles return to their level-flight orientation and hold their original track against wind and external forces. Fixed-wing (FW) vehicles level orientation and maintain current track and altitude against wind and external forces. Hybrid MC/FW (\"VTOL\") vehicles first transition to FW mode (if needed) but otherwise behave in the same way as MC vehicles. Multicopter (MC) vehicles must not support this mode. Other vehicle types must not support this mode (this may be revisited through the PR process)."]
3361 MAV_STANDARD_MODE_CRUISE = 3,
3362 #[doc = "Altitude hold (manual). Altitude-controlled and stabilized manual mode. When sticks are released vehicles return to their level-flight orientation and hold their altitude. MC vehicles continue with existing momentum and may move with wind (or other external forces). FW vehicles continue with current heading, but may be moved off-track by wind. Hybrid MC/FW (\"VTOL\") vehicles behave according to their current configuration/mode (FW or MC). Other vehicle types must not support this mode (this may be revisited through the PR process)."]
3363 MAV_STANDARD_MODE_ALTITUDE_HOLD = 4,
3364 #[doc = "Safe recovery mode (auto). Automatic mode that takes vehicle to a predefined safe location via a safe flight path, and may also automatically land the vehicle. This mode is more commonly referred to as RTL and/or or Smart RTL. The precise return location, flight path, and landing behaviour depend on vehicle configuration and type. For example, the vehicle might return to the home/launch location, a rally point, or the start of a mission landing, it might follow a direct path, mission path, or breadcrumb path, and land using a mission landing pattern or some other kind of descent."]
3365 MAV_STANDARD_MODE_SAFE_RECOVERY = 5,
3366 #[doc = "Mission mode (automatic). Automatic mode that executes MAVLink missions. Missions are executed from the current waypoint as soon as the mode is enabled."]
3367 MAV_STANDARD_MODE_MISSION = 6,
3368 #[doc = "Land mode (auto). Automatic mode that lands the vehicle at the current location. The precise landing behaviour depends on vehicle configuration and type."]
3369 MAV_STANDARD_MODE_LAND = 7,
3370 #[doc = "Takeoff mode (auto). Automatic takeoff mode. The precise takeoff behaviour depends on vehicle configuration and type."]
3371 MAV_STANDARD_MODE_TAKEOFF = 8,
3372}
3373impl MavStandardMode {
3374 pub const DEFAULT: Self = Self::MAV_STANDARD_MODE_NON_STANDARD;
3375}
3376impl Default for MavStandardMode {
3377 fn default() -> Self {
3378 Self::DEFAULT
3379 }
3380}
3381#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3382#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3383#[cfg_attr(feature = "serde", serde(tag = "type"))]
3384#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3385#[repr(u32)]
3386pub enum MavState {
3387 #[doc = "Uninitialized system, state is unknown."]
3388 MAV_STATE_UNINIT = 0,
3389 #[doc = "System is booting up."]
3390 MAV_STATE_BOOT = 1,
3391 #[doc = "System is calibrating and not flight-ready."]
3392 MAV_STATE_CALIBRATING = 2,
3393 #[doc = "System is grounded and on standby. It can be launched any time."]
3394 MAV_STATE_STANDBY = 3,
3395 #[doc = "System is active and might be already airborne. Motors are engaged."]
3396 MAV_STATE_ACTIVE = 4,
3397 #[doc = "System is in a non-normal flight mode (failsafe). It can however still navigate."]
3398 MAV_STATE_CRITICAL = 5,
3399 #[doc = "System is in a non-normal flight mode (failsafe). It lost control over parts or over the whole airframe. It is in mayday and going down."]
3400 MAV_STATE_EMERGENCY = 6,
3401 #[doc = "System just initialized its power-down sequence, will shut down now."]
3402 MAV_STATE_POWEROFF = 7,
3403 #[doc = "System is terminating itself (failsafe or commanded)."]
3404 MAV_STATE_FLIGHT_TERMINATION = 8,
3405}
3406impl MavState {
3407 pub const DEFAULT: Self = Self::MAV_STATE_UNINIT;
3408}
3409impl Default for MavState {
3410 fn default() -> Self {
3411 Self::DEFAULT
3412 }
3413}
3414bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These encode the sensors whose status is sent as part of the SYS_STATUS message."] pub struct MavSysStatusSensor : u32 { # [doc = "0x01 3D gyro"] const MAV_SYS_STATUS_SENSOR_3D_GYRO = 1 ; # [doc = "0x02 3D accelerometer"] const MAV_SYS_STATUS_SENSOR_3D_ACCEL = 2 ; # [doc = "0x04 3D magnetometer"] const MAV_SYS_STATUS_SENSOR_3D_MAG = 4 ; # [doc = "0x08 absolute pressure"] const MAV_SYS_STATUS_SENSOR_ABSOLUTE_PRESSURE = 8 ; # [doc = "0x10 differential pressure"] const MAV_SYS_STATUS_SENSOR_DIFFERENTIAL_PRESSURE = 16 ; # [doc = "0x20 GPS"] const MAV_SYS_STATUS_SENSOR_GPS = 32 ; # [doc = "0x40 optical flow"] const MAV_SYS_STATUS_SENSOR_OPTICAL_FLOW = 64 ; # [doc = "0x80 computer vision position"] const MAV_SYS_STATUS_SENSOR_VISION_POSITION = 128 ; # [doc = "0x100 laser based position"] const MAV_SYS_STATUS_SENSOR_LASER_POSITION = 256 ; # [doc = "0x200 external ground truth (Vicon or Leica)"] const MAV_SYS_STATUS_SENSOR_EXTERNAL_GROUND_TRUTH = 512 ; # [doc = "0x400 3D angular rate control"] const MAV_SYS_STATUS_SENSOR_ANGULAR_RATE_CONTROL = 1024 ; # [doc = "0x800 attitude stabilization"] const MAV_SYS_STATUS_SENSOR_ATTITUDE_STABILIZATION = 2048 ; # [doc = "0x1000 yaw position"] const MAV_SYS_STATUS_SENSOR_YAW_POSITION = 4096 ; # [doc = "0x2000 z/altitude control"] const MAV_SYS_STATUS_SENSOR_Z_ALTITUDE_CONTROL = 8192 ; # [doc = "0x4000 x/y position control"] const MAV_SYS_STATUS_SENSOR_XY_POSITION_CONTROL = 16384 ; # [doc = "0x8000 motor outputs / control"] const MAV_SYS_STATUS_SENSOR_MOTOR_OUTPUTS = 32768 ; # [doc = "0x10000 RC receiver"] const MAV_SYS_STATUS_SENSOR_RC_RECEIVER = 65536 ; # [doc = "0x20000 2nd 3D gyro"] const MAV_SYS_STATUS_SENSOR_3D_GYRO2 = 131072 ; # [doc = "0x40000 2nd 3D accelerometer"] const MAV_SYS_STATUS_SENSOR_3D_ACCEL2 = 262144 ; # [doc = "0x80000 2nd 3D magnetometer"] const MAV_SYS_STATUS_SENSOR_3D_MAG2 = 524288 ; # [doc = "0x100000 geofence"] const MAV_SYS_STATUS_GEOFENCE = 1048576 ; # [doc = "0x200000 AHRS subsystem health"] const MAV_SYS_STATUS_AHRS = 2097152 ; # [doc = "0x400000 Terrain subsystem health"] const MAV_SYS_STATUS_TERRAIN = 4194304 ; # [doc = "0x800000 Motors are reversed"] const MAV_SYS_STATUS_REVERSE_MOTOR = 8388608 ; # [doc = "0x1000000 Logging"] const MAV_SYS_STATUS_LOGGING = 16777216 ; # [doc = "0x2000000 Battery"] const MAV_SYS_STATUS_SENSOR_BATTERY = 33554432 ; # [doc = "0x4000000 Proximity"] const MAV_SYS_STATUS_SENSOR_PROXIMITY = 67108864 ; # [doc = "0x8000000 Satellite Communication"] const MAV_SYS_STATUS_SENSOR_SATCOM = 134217728 ; # [doc = "0x10000000 pre-arm check status. Always healthy when armed"] const MAV_SYS_STATUS_PREARM_CHECK = 268435456 ; # [doc = "0x20000000 Avoidance/collision prevention"] const MAV_SYS_STATUS_OBSTACLE_AVOIDANCE = 536870912 ; # [doc = "0x40000000 propulsion (actuator, esc, motor or propellor)"] const MAV_SYS_STATUS_SENSOR_PROPULSION = 1073741824 ; # [doc = "0x80000000 Extended bit-field are used for further sensor status bits (needs to be set in onboard_control_sensors_present only)"] const MAV_SYS_STATUS_EXTENSION_USED = 2147483648 ; } }
3415impl MavSysStatusSensor {
3416 pub const DEFAULT: Self = Self::MAV_SYS_STATUS_SENSOR_3D_GYRO;
3417}
3418impl Default for MavSysStatusSensor {
3419 fn default() -> Self {
3420 Self::DEFAULT
3421 }
3422}
3423bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These encode the sensors whose status is sent as part of the SYS_STATUS message in the extended fields."] pub struct MavSysStatusSensorExtended : u32 { # [doc = "0x01 Recovery system (parachute, balloon, retracts etc)"] const MAV_SYS_STATUS_RECOVERY_SYSTEM = 1 ; } }
3424impl MavSysStatusSensorExtended {
3425 pub const DEFAULT: Self = Self::MAV_SYS_STATUS_RECOVERY_SYSTEM;
3426}
3427impl Default for MavSysStatusSensorExtended {
3428 fn default() -> Self {
3429 Self::DEFAULT
3430 }
3431}
3432#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3433#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3434#[cfg_attr(feature = "serde", serde(tag = "type"))]
3435#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3436#[repr(u32)]
3437pub enum MavTunnelPayloadType {
3438 #[doc = "Encoding of payload unknown."]
3439 MAV_TUNNEL_PAYLOAD_TYPE_UNKNOWN = 0,
3440 #[doc = "Registered for STorM32 gimbal controller."]
3441 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED0 = 200,
3442 #[doc = "Registered for STorM32 gimbal controller."]
3443 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED1 = 201,
3444 #[doc = "Registered for STorM32 gimbal controller."]
3445 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED2 = 202,
3446 #[doc = "Registered for STorM32 gimbal controller."]
3447 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED3 = 203,
3448 #[doc = "Registered for STorM32 gimbal controller."]
3449 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED4 = 204,
3450 #[doc = "Registered for STorM32 gimbal controller."]
3451 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED5 = 205,
3452 #[doc = "Registered for STorM32 gimbal controller."]
3453 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED6 = 206,
3454 #[doc = "Registered for STorM32 gimbal controller."]
3455 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED7 = 207,
3456 #[doc = "Registered for STorM32 gimbal controller."]
3457 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED8 = 208,
3458 #[doc = "Registered for STorM32 gimbal controller."]
3459 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED9 = 209,
3460 #[doc = "Registered for ModalAI remote OSD protocol."]
3461 MAV_TUNNEL_PAYLOAD_TYPE_MODALAI_REMOTE_OSD = 210,
3462 #[doc = "Registered for ModalAI ESC UART passthru protocol."]
3463 MAV_TUNNEL_PAYLOAD_TYPE_MODALAI_ESC_UART_PASSTHRU = 211,
3464 #[doc = "Registered for ModalAI vendor use."]
3465 MAV_TUNNEL_PAYLOAD_TYPE_MODALAI_IO_UART_PASSTHRU = 212,
3466}
3467impl MavTunnelPayloadType {
3468 pub const DEFAULT: Self = Self::MAV_TUNNEL_PAYLOAD_TYPE_UNKNOWN;
3469}
3470impl Default for MavTunnelPayloadType {
3471 fn default() -> Self {
3472 Self::DEFAULT
3473 }
3474}
3475#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3476#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3477#[cfg_attr(feature = "serde", serde(tag = "type"))]
3478#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3479#[repr(u32)]
3480#[doc = "MAVLINK component type reported in HEARTBEAT message. Flight controllers must report the type of the vehicle on which they are mounted (e.g. MAV_TYPE_OCTOROTOR). All other components must report a value appropriate for their type (e.g. a camera must use MAV_TYPE_CAMERA)."]
3481pub enum MavType {
3482 #[doc = "Generic micro air vehicle"]
3483 MAV_TYPE_GENERIC = 0,
3484 #[doc = "Fixed wing aircraft."]
3485 MAV_TYPE_FIXED_WING = 1,
3486 #[doc = "Quadrotor"]
3487 MAV_TYPE_QUADROTOR = 2,
3488 #[doc = "Coaxial helicopter"]
3489 MAV_TYPE_COAXIAL = 3,
3490 #[doc = "Normal helicopter with tail rotor."]
3491 MAV_TYPE_HELICOPTER = 4,
3492 #[doc = "Ground installation"]
3493 MAV_TYPE_ANTENNA_TRACKER = 5,
3494 #[doc = "Operator control unit / ground control station"]
3495 MAV_TYPE_GCS = 6,
3496 #[doc = "Airship, controlled"]
3497 MAV_TYPE_AIRSHIP = 7,
3498 #[doc = "Free balloon, uncontrolled"]
3499 MAV_TYPE_FREE_BALLOON = 8,
3500 #[doc = "Rocket"]
3501 MAV_TYPE_ROCKET = 9,
3502 #[doc = "Ground rover"]
3503 MAV_TYPE_GROUND_ROVER = 10,
3504 #[doc = "Surface vessel, boat, ship"]
3505 MAV_TYPE_SURFACE_BOAT = 11,
3506 #[doc = "Submarine"]
3507 MAV_TYPE_SUBMARINE = 12,
3508 #[doc = "Hexarotor"]
3509 MAV_TYPE_HEXAROTOR = 13,
3510 #[doc = "Octorotor"]
3511 MAV_TYPE_OCTOROTOR = 14,
3512 #[doc = "Tricopter"]
3513 MAV_TYPE_TRICOPTER = 15,
3514 #[doc = "Flapping wing"]
3515 MAV_TYPE_FLAPPING_WING = 16,
3516 #[doc = "Kite"]
3517 MAV_TYPE_KITE = 17,
3518 #[doc = "Onboard companion controller"]
3519 MAV_TYPE_ONBOARD_CONTROLLER = 18,
3520 #[doc = "Two-rotor Tailsitter VTOL that additionally uses control surfaces in vertical operation. Note, value previously named MAV_TYPE_VTOL_DUOROTOR."]
3521 MAV_TYPE_VTOL_TAILSITTER_DUOROTOR = 19,
3522 #[doc = "Quad-rotor Tailsitter VTOL using a V-shaped quad config in vertical operation. Note: value previously named MAV_TYPE_VTOL_QUADROTOR."]
3523 MAV_TYPE_VTOL_TAILSITTER_QUADROTOR = 20,
3524 #[doc = "Tiltrotor VTOL. Fuselage and wings stay (nominally) horizontal in all flight phases. It able to tilt (some) rotors to provide thrust in cruise flight."]
3525 MAV_TYPE_VTOL_TILTROTOR = 21,
3526 #[doc = "VTOL with separate fixed rotors for hover and cruise flight. Fuselage and wings stay (nominally) horizontal in all flight phases."]
3527 MAV_TYPE_VTOL_FIXEDROTOR = 22,
3528 #[doc = "Tailsitter VTOL. Fuselage and wings orientation changes depending on flight phase: vertical for hover, horizontal for cruise. Use more specific VTOL MAV_TYPE_VTOL_TAILSITTER_DUOROTOR or MAV_TYPE_VTOL_TAILSITTER_QUADROTOR if appropriate."]
3529 MAV_TYPE_VTOL_TAILSITTER = 23,
3530 #[doc = "Tiltwing VTOL. Fuselage stays horizontal in all flight phases. The whole wing, along with any attached engine, can tilt between vertical and horizontal mode."]
3531 MAV_TYPE_VTOL_TILTWING = 24,
3532 #[doc = "VTOL reserved 5"]
3533 MAV_TYPE_VTOL_RESERVED5 = 25,
3534 #[doc = "Gimbal"]
3535 MAV_TYPE_GIMBAL = 26,
3536 #[doc = "ADSB system"]
3537 MAV_TYPE_ADSB = 27,
3538 #[doc = "Steerable, nonrigid airfoil"]
3539 MAV_TYPE_PARAFOIL = 28,
3540 #[doc = "Dodecarotor"]
3541 MAV_TYPE_DODECAROTOR = 29,
3542 #[doc = "Camera"]
3543 MAV_TYPE_CAMERA = 30,
3544 #[doc = "Charging station"]
3545 MAV_TYPE_CHARGING_STATION = 31,
3546 #[doc = "FLARM collision avoidance system"]
3547 MAV_TYPE_FLARM = 32,
3548 #[doc = "Servo"]
3549 MAV_TYPE_SERVO = 33,
3550 #[doc = "Open Drone ID. See <https://mavlink.io/en/services/opendroneid.html>."]
3551 MAV_TYPE_ODID = 34,
3552 #[doc = "Decarotor"]
3553 MAV_TYPE_DECAROTOR = 35,
3554 #[doc = "Battery"]
3555 MAV_TYPE_BATTERY = 36,
3556 #[doc = "Parachute"]
3557 MAV_TYPE_PARACHUTE = 37,
3558 #[doc = "Log"]
3559 MAV_TYPE_LOG = 38,
3560 #[doc = "OSD"]
3561 MAV_TYPE_OSD = 39,
3562 #[doc = "IMU"]
3563 MAV_TYPE_IMU = 40,
3564 #[doc = "GPS"]
3565 MAV_TYPE_GPS = 41,
3566 #[doc = "Winch"]
3567 MAV_TYPE_WINCH = 42,
3568 #[doc = "Generic multirotor that does not fit into a specific type or whose type is unknown"]
3569 MAV_TYPE_GENERIC_MULTIROTOR = 43,
3570 #[doc = "Illuminator. An illuminator is a light source that is used for lighting up dark areas external to the sytstem: e.g. a torch or searchlight (as opposed to a light source for illuminating the system itself, e.g. an indicator light)."]
3571 MAV_TYPE_ILLUMINATOR = 44,
3572 #[doc = "Orbiter spacecraft. Includes satellites orbiting terrestrial and extra-terrestrial bodies. Follows NASA Spacecraft Classification."]
3573 MAV_TYPE_SPACECRAFT_ORBITER = 45,
3574}
3575impl MavType {
3576 pub const DEFAULT: Self = Self::MAV_TYPE_GENERIC;
3577}
3578impl Default for MavType {
3579 fn default() -> Self {
3580 Self::DEFAULT
3581 }
3582}
3583#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3584#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3585#[cfg_attr(feature = "serde", serde(tag = "type"))]
3586#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3587#[repr(u32)]
3588#[doc = "Enumeration of VTOL states"]
3589pub enum MavVtolState {
3590 #[doc = "MAV is not configured as VTOL"]
3591 MAV_VTOL_STATE_UNDEFINED = 0,
3592 #[doc = "VTOL is in transition from multicopter to fixed-wing"]
3593 MAV_VTOL_STATE_TRANSITION_TO_FW = 1,
3594 #[doc = "VTOL is in transition from fixed-wing to multicopter"]
3595 MAV_VTOL_STATE_TRANSITION_TO_MC = 2,
3596 #[doc = "VTOL is in multicopter state"]
3597 MAV_VTOL_STATE_MC = 3,
3598 #[doc = "VTOL is in fixed-wing state"]
3599 MAV_VTOL_STATE_FW = 4,
3600}
3601impl MavVtolState {
3602 pub const DEFAULT: Self = Self::MAV_VTOL_STATE_UNDEFINED;
3603}
3604impl Default for MavVtolState {
3605 fn default() -> Self {
3606 Self::DEFAULT
3607 }
3608}
3609bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Winch status flags used in WINCH_STATUS"] pub struct MavWinchStatusFlag : u32 { # [doc = "Winch is healthy"] const MAV_WINCH_STATUS_HEALTHY = 1 ; # [doc = "Winch line is fully retracted"] const MAV_WINCH_STATUS_FULLY_RETRACTED = 2 ; # [doc = "Winch motor is moving"] const MAV_WINCH_STATUS_MOVING = 4 ; # [doc = "Winch clutch is engaged allowing motor to move freely."] const MAV_WINCH_STATUS_CLUTCH_ENGAGED = 8 ; # [doc = "Winch is locked by locking mechanism."] const MAV_WINCH_STATUS_LOCKED = 16 ; # [doc = "Winch is gravity dropping payload."] const MAV_WINCH_STATUS_DROPPING = 32 ; # [doc = "Winch is arresting payload descent."] const MAV_WINCH_STATUS_ARRESTING = 64 ; # [doc = "Winch is using torque measurements to sense the ground."] const MAV_WINCH_STATUS_GROUND_SENSE = 128 ; # [doc = "Winch is returning to the fully retracted position."] const MAV_WINCH_STATUS_RETRACTING = 256 ; # [doc = "Winch is redelivering the payload. This is a failover state if the line tension goes above a threshold during RETRACTING."] const MAV_WINCH_STATUS_REDELIVER = 512 ; # [doc = "Winch is abandoning the line and possibly payload. Winch unspools the entire calculated line length. This is a failover state from REDELIVER if the number of attempts exceeds a threshold."] const MAV_WINCH_STATUS_ABANDON_LINE = 1024 ; # [doc = "Winch is engaging the locking mechanism."] const MAV_WINCH_STATUS_LOCKING = 2048 ; # [doc = "Winch is spooling on line."] const MAV_WINCH_STATUS_LOAD_LINE = 4096 ; # [doc = "Winch is loading a payload."] const MAV_WINCH_STATUS_LOAD_PAYLOAD = 8192 ; } }
3610impl MavWinchStatusFlag {
3611 pub const DEFAULT: Self = Self::MAV_WINCH_STATUS_HEALTHY;
3612}
3613impl Default for MavWinchStatusFlag {
3614 fn default() -> Self {
3615 Self::DEFAULT
3616 }
3617}
3618#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3619#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3620#[cfg_attr(feature = "serde", serde(tag = "type"))]
3621#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3622#[repr(u32)]
3623pub enum MavlinkDataStreamType {
3624 MAVLINK_DATA_STREAM_IMG_JPEG = 0,
3625 MAVLINK_DATA_STREAM_IMG_BMP = 1,
3626 MAVLINK_DATA_STREAM_IMG_RAW8U = 2,
3627 MAVLINK_DATA_STREAM_IMG_RAW32U = 3,
3628 MAVLINK_DATA_STREAM_IMG_PGM = 4,
3629 MAVLINK_DATA_STREAM_IMG_PNG = 5,
3630}
3631impl MavlinkDataStreamType {
3632 pub const DEFAULT: Self = Self::MAVLINK_DATA_STREAM_IMG_JPEG;
3633}
3634impl Default for MavlinkDataStreamType {
3635 fn default() -> Self {
3636 Self::DEFAULT
3637 }
3638}
3639#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3640#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3641#[cfg_attr(feature = "serde", serde(tag = "type"))]
3642#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3643#[repr(u32)]
3644#[doc = "States of the mission state machine. Note that these states are independent of whether the mission is in a mode that can execute mission items or not (is suspended). They may not all be relevant on all vehicles."]
3645pub enum MissionState {
3646 #[doc = "The mission status reporting is not supported."]
3647 MISSION_STATE_UNKNOWN = 0,
3648 #[doc = "No mission on the vehicle."]
3649 MISSION_STATE_NO_MISSION = 1,
3650 #[doc = "Mission has not started. This is the case after a mission has uploaded but not yet started executing."]
3651 MISSION_STATE_NOT_STARTED = 2,
3652 #[doc = "Mission is active, and will execute mission items when in auto mode."]
3653 MISSION_STATE_ACTIVE = 3,
3654 #[doc = "Mission is paused when in auto mode."]
3655 MISSION_STATE_PAUSED = 4,
3656 #[doc = "Mission has executed all mission items."]
3657 MISSION_STATE_COMPLETE = 5,
3658}
3659impl MissionState {
3660 pub const DEFAULT: Self = Self::MISSION_STATE_UNKNOWN;
3661}
3662impl Default for MissionState {
3663 fn default() -> Self {
3664 Self::DEFAULT
3665 }
3666}
3667#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3668#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3669#[cfg_attr(feature = "serde", serde(tag = "type"))]
3670#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3671#[repr(u32)]
3672#[doc = "Sequence that motors are tested when using MAV_CMD_DO_MOTOR_TEST."]
3673pub enum MotorTestOrder {
3674 #[doc = "Default autopilot motor test method."]
3675 MOTOR_TEST_ORDER_DEFAULT = 0,
3676 #[doc = "Motor numbers are specified as their index in a predefined vehicle-specific sequence."]
3677 MOTOR_TEST_ORDER_SEQUENCE = 1,
3678 #[doc = "Motor numbers are specified as the output as labeled on the board."]
3679 MOTOR_TEST_ORDER_BOARD = 2,
3680}
3681impl MotorTestOrder {
3682 pub const DEFAULT: Self = Self::MOTOR_TEST_ORDER_DEFAULT;
3683}
3684impl Default for MotorTestOrder {
3685 fn default() -> Self {
3686 Self::DEFAULT
3687 }
3688}
3689#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3690#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3691#[cfg_attr(feature = "serde", serde(tag = "type"))]
3692#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3693#[repr(u32)]
3694#[doc = "Defines how throttle value is represented in MAV_CMD_DO_MOTOR_TEST."]
3695pub enum MotorTestThrottleType {
3696 #[doc = "Throttle as a percentage (0 ~ 100)"]
3697 MOTOR_TEST_THROTTLE_PERCENT = 0,
3698 #[doc = "Throttle as an absolute PWM value (normally in range of 1000~2000)."]
3699 MOTOR_TEST_THROTTLE_PWM = 1,
3700 #[doc = "Throttle pass-through from pilot's transmitter."]
3701 MOTOR_TEST_THROTTLE_PILOT = 2,
3702 #[doc = "Per-motor compass calibration test."]
3703 MOTOR_TEST_COMPASS_CAL = 3,
3704}
3705impl MotorTestThrottleType {
3706 pub const DEFAULT: Self = Self::MOTOR_TEST_THROTTLE_PERCENT;
3707}
3708impl Default for MotorTestThrottleType {
3709 fn default() -> Self {
3710 Self::DEFAULT
3711 }
3712}
3713#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3714#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3715#[cfg_attr(feature = "serde", serde(tag = "type"))]
3716#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3717#[repr(u32)]
3718pub enum NavVtolLandOptions {
3719 #[doc = "Default autopilot landing behaviour."]
3720 NAV_VTOL_LAND_OPTIONS_DEFAULT = 0,
3721 #[doc = "Descend in fixed wing mode, transitioning to multicopter mode for vertical landing when close to the ground. The fixed wing descent pattern is at the discretion of the vehicle (e.g. transition altitude, loiter direction, radius, and speed, etc.)."]
3722 NAV_VTOL_LAND_OPTIONS_FW_DESCENT = 1,
3723 #[doc = "Land in multicopter mode on reaching the landing coordinates (the whole landing is by \"hover descent\")."]
3724 NAV_VTOL_LAND_OPTIONS_HOVER_DESCENT = 2,
3725}
3726impl NavVtolLandOptions {
3727 pub const DEFAULT: Self = Self::NAV_VTOL_LAND_OPTIONS_DEFAULT;
3728}
3729impl Default for NavVtolLandOptions {
3730 fn default() -> Self {
3731 Self::DEFAULT
3732 }
3733}
3734#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3735#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3736#[cfg_attr(feature = "serde", serde(tag = "type"))]
3737#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3738#[repr(u32)]
3739#[doc = "Yaw behaviour during orbit flight."]
3740pub enum OrbitYawBehaviour {
3741 #[doc = "Vehicle front points to the center (default)."]
3742 ORBIT_YAW_BEHAVIOUR_HOLD_FRONT_TO_CIRCLE_CENTER = 0,
3743 #[doc = "Vehicle front holds heading when message received."]
3744 ORBIT_YAW_BEHAVIOUR_HOLD_INITIAL_HEADING = 1,
3745 #[doc = "Yaw uncontrolled."]
3746 ORBIT_YAW_BEHAVIOUR_UNCONTROLLED = 2,
3747 #[doc = "Vehicle front follows flight path (tangential to circle)."]
3748 ORBIT_YAW_BEHAVIOUR_HOLD_FRONT_TANGENT_TO_CIRCLE = 3,
3749 #[doc = "Yaw controlled by RC input."]
3750 ORBIT_YAW_BEHAVIOUR_RC_CONTROLLED = 4,
3751 #[doc = "Vehicle uses current yaw behaviour (unchanged). The vehicle-default yaw behaviour is used if this value is specified when orbit is first commanded."]
3752 ORBIT_YAW_BEHAVIOUR_UNCHANGED = 5,
3753}
3754impl OrbitYawBehaviour {
3755 pub const DEFAULT: Self = Self::ORBIT_YAW_BEHAVIOUR_HOLD_FRONT_TO_CIRCLE_CENTER;
3756}
3757impl Default for OrbitYawBehaviour {
3758 fn default() -> Self {
3759 Self::DEFAULT
3760 }
3761}
3762#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3763#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3764#[cfg_attr(feature = "serde", serde(tag = "type"))]
3765#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3766#[repr(u32)]
3767#[doc = "Parachute actions. Trigger release and enable/disable auto-release."]
3768pub enum ParachuteAction {
3769 #[doc = "Disable auto-release of parachute (i.e. release triggered by crash detectors)."]
3770 PARACHUTE_DISABLE = 0,
3771 #[doc = "Enable auto-release of parachute."]
3772 PARACHUTE_ENABLE = 1,
3773 #[doc = "Release parachute and kill motors."]
3774 PARACHUTE_RELEASE = 2,
3775}
3776impl ParachuteAction {
3777 pub const DEFAULT: Self = Self::PARACHUTE_DISABLE;
3778}
3779impl Default for ParachuteAction {
3780 fn default() -> Self {
3781 Self::DEFAULT
3782 }
3783}
3784#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3785#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3786#[cfg_attr(feature = "serde", serde(tag = "type"))]
3787#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3788#[repr(u32)]
3789#[doc = "Result from PARAM_EXT_SET message."]
3790pub enum ParamAck {
3791 #[doc = "Parameter value ACCEPTED and SET"]
3792 PARAM_ACK_ACCEPTED = 0,
3793 #[doc = "Parameter value UNKNOWN/UNSUPPORTED"]
3794 PARAM_ACK_VALUE_UNSUPPORTED = 1,
3795 #[doc = "Parameter failed to set"]
3796 PARAM_ACK_FAILED = 2,
3797 #[doc = "Parameter value received but not yet set/accepted. A subsequent PARAM_EXT_ACK with the final result will follow once operation is completed. This is returned immediately for parameters that take longer to set, indicating that the the parameter was received and does not need to be resent."]
3798 PARAM_ACK_IN_PROGRESS = 3,
3799}
3800impl ParamAck {
3801 pub const DEFAULT: Self = Self::PARAM_ACK_ACCEPTED;
3802}
3803impl Default for ParamAck {
3804 fn default() -> Self {
3805 Self::DEFAULT
3806 }
3807}
3808bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Bitmap to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 9 is set the floats afx afy afz should be interpreted as force instead of acceleration."] pub struct PositionTargetTypemask : u16 { # [doc = "Ignore position x"] const POSITION_TARGET_TYPEMASK_X_IGNORE = 1 ; # [doc = "Ignore position y"] const POSITION_TARGET_TYPEMASK_Y_IGNORE = 2 ; # [doc = "Ignore position z"] const POSITION_TARGET_TYPEMASK_Z_IGNORE = 4 ; # [doc = "Ignore velocity x"] const POSITION_TARGET_TYPEMASK_VX_IGNORE = 8 ; # [doc = "Ignore velocity y"] const POSITION_TARGET_TYPEMASK_VY_IGNORE = 16 ; # [doc = "Ignore velocity z"] const POSITION_TARGET_TYPEMASK_VZ_IGNORE = 32 ; # [doc = "Ignore acceleration x"] const POSITION_TARGET_TYPEMASK_AX_IGNORE = 64 ; # [doc = "Ignore acceleration y"] const POSITION_TARGET_TYPEMASK_AY_IGNORE = 128 ; # [doc = "Ignore acceleration z"] const POSITION_TARGET_TYPEMASK_AZ_IGNORE = 256 ; # [doc = "Use force instead of acceleration"] const POSITION_TARGET_TYPEMASK_FORCE_SET = 512 ; # [doc = "Ignore yaw"] const POSITION_TARGET_TYPEMASK_YAW_IGNORE = 1024 ; # [doc = "Ignore yaw rate"] const POSITION_TARGET_TYPEMASK_YAW_RATE_IGNORE = 2048 ; } }
3809impl PositionTargetTypemask {
3810 pub const DEFAULT: Self = Self::POSITION_TARGET_TYPEMASK_X_IGNORE;
3811}
3812impl Default for PositionTargetTypemask {
3813 fn default() -> Self {
3814 Self::DEFAULT
3815 }
3816}
3817#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3818#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3819#[cfg_attr(feature = "serde", serde(tag = "type"))]
3820#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3821#[repr(u32)]
3822#[doc = "Precision land modes (used in MAV_CMD_NAV_LAND)."]
3823pub enum PrecisionLandMode {
3824 #[doc = "Normal (non-precision) landing."]
3825 PRECISION_LAND_MODE_DISABLED = 0,
3826 #[doc = "Use precision landing if beacon detected when land command accepted, otherwise land normally."]
3827 PRECISION_LAND_MODE_OPPORTUNISTIC = 1,
3828 #[doc = "Use precision landing, searching for beacon if not found when land command accepted (land normally if beacon cannot be found)."]
3829 PRECISION_LAND_MODE_REQUIRED = 2,
3830}
3831impl PrecisionLandMode {
3832 pub const DEFAULT: Self = Self::PRECISION_LAND_MODE_DISABLED;
3833}
3834impl Default for PrecisionLandMode {
3835 fn default() -> Self {
3836 Self::DEFAULT
3837 }
3838}
3839#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3840#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3841#[cfg_attr(feature = "serde", serde(tag = "type"))]
3842#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3843#[repr(u32)]
3844#[doc = "Actions for reading and writing plan information (mission, rally points, geofence) between persistent and volatile storage when using MAV_CMD_PREFLIGHT_STORAGE. (Commonly missions are loaded from persistent storage (flash/EEPROM) into volatile storage (RAM) on startup and written back when they are changed.)"]
3845pub enum PreflightStorageMissionAction {
3846 #[doc = "Read current mission data from persistent storage"]
3847 MISSION_READ_PERSISTENT = 0,
3848 #[doc = "Write current mission data to persistent storage"]
3849 MISSION_WRITE_PERSISTENT = 1,
3850 #[doc = "Erase all mission data stored on the vehicle (both persistent and volatile storage)"]
3851 MISSION_RESET_DEFAULT = 2,
3852}
3853impl PreflightStorageMissionAction {
3854 pub const DEFAULT: Self = Self::MISSION_READ_PERSISTENT;
3855}
3856impl Default for PreflightStorageMissionAction {
3857 fn default() -> Self {
3858 Self::DEFAULT
3859 }
3860}
3861#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3862#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3863#[cfg_attr(feature = "serde", serde(tag = "type"))]
3864#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3865#[repr(u32)]
3866#[doc = "Actions for reading/writing parameters between persistent and volatile storage when using MAV_CMD_PREFLIGHT_STORAGE. (Commonly parameters are loaded from persistent storage (flash/EEPROM) into volatile storage (RAM) on startup and written back when they are changed.)"]
3867pub enum PreflightStorageParameterAction {
3868 #[doc = "Read all parameters from persistent storage. Replaces values in volatile storage."]
3869 PARAM_READ_PERSISTENT = 0,
3870 #[doc = "Write all parameter values to persistent storage (flash/EEPROM)"]
3871 PARAM_WRITE_PERSISTENT = 1,
3872 #[doc = "Reset all user configurable parameters to their default value (including airframe selection, sensor calibration data, safety settings, and so on). Does not reset values that contain operation counters and vehicle computed statistics."]
3873 PARAM_RESET_CONFIG_DEFAULT = 2,
3874 #[doc = "Reset only sensor calibration parameters to factory defaults (or firmware default if not available)"]
3875 PARAM_RESET_SENSOR_DEFAULT = 3,
3876 #[doc = "Reset all parameters, including operation counters, to default values"]
3877 PARAM_RESET_ALL_DEFAULT = 4,
3878}
3879impl PreflightStorageParameterAction {
3880 pub const DEFAULT: Self = Self::PARAM_READ_PERSISTENT;
3881}
3882impl Default for PreflightStorageParameterAction {
3883 fn default() -> Self {
3884 Self::DEFAULT
3885 }
3886}
3887#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3888#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3889#[cfg_attr(feature = "serde", serde(tag = "type"))]
3890#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3891#[repr(u32)]
3892#[doc = "RC sub-type of types defined in RC_TYPE. Used in MAV_CMD_START_RX_PAIR. Ignored if value does not correspond to the set RC_TYPE."]
3893pub enum RcSubType {
3894 #[doc = "Spektrum DSM2"]
3895 RC_SUB_TYPE_SPEKTRUM_DSM2 = 0,
3896 #[doc = "Spektrum DSMX"]
3897 RC_SUB_TYPE_SPEKTRUM_DSMX = 1,
3898 #[doc = "Spektrum DSMX8"]
3899 RC_SUB_TYPE_SPEKTRUM_DSMX8 = 2,
3900}
3901impl RcSubType {
3902 pub const DEFAULT: Self = Self::RC_SUB_TYPE_SPEKTRUM_DSM2;
3903}
3904impl Default for RcSubType {
3905 fn default() -> Self {
3906 Self::DEFAULT
3907 }
3908}
3909#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3910#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3911#[cfg_attr(feature = "serde", serde(tag = "type"))]
3912#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3913#[repr(u32)]
3914#[doc = "RC type. Used in MAV_CMD_START_RX_PAIR."]
3915pub enum RcType {
3916 #[doc = "Spektrum"]
3917 RC_TYPE_SPEKTRUM = 0,
3918 #[doc = "CRSF"]
3919 RC_TYPE_CRSF = 1,
3920}
3921impl RcType {
3922 pub const DEFAULT: Self = Self::RC_TYPE_SPEKTRUM;
3923}
3924impl Default for RcType {
3925 fn default() -> Self {
3926 Self::DEFAULT
3927 }
3928}
3929#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3930#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3931#[cfg_attr(feature = "serde", serde(tag = "type"))]
3932#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3933#[repr(u32)]
3934#[doc = "Specifies the conditions under which the MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN command should be accepted."]
3935pub enum RebootShutdownConditions {
3936 #[doc = "Reboot/Shutdown only if allowed by safety checks, such as being landed."]
3937 REBOOT_SHUTDOWN_CONDITIONS_SAFETY_INTERLOCKED = 0,
3938 #[doc = "Force reboot/shutdown of the autopilot/component regardless of system state."]
3939 REBOOT_SHUTDOWN_CONDITIONS_FORCE = 20190226,
3940}
3941impl RebootShutdownConditions {
3942 pub const DEFAULT: Self = Self::REBOOT_SHUTDOWN_CONDITIONS_SAFETY_INTERLOCKED;
3943}
3944impl Default for RebootShutdownConditions {
3945 fn default() -> Self {
3946 Self::DEFAULT
3947 }
3948}
3949#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3950#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3951#[cfg_attr(feature = "serde", serde(tag = "type"))]
3952#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3953#[repr(u32)]
3954#[doc = "RTK GPS baseline coordinate system, used for RTK corrections"]
3955pub enum RtkBaselineCoordinateSystem {
3956 #[doc = "Earth-centered, Earth-fixed"]
3957 RTK_BASELINE_COORDINATE_SYSTEM_ECEF = 0,
3958 #[doc = "RTK basestation centered, north, east, down"]
3959 RTK_BASELINE_COORDINATE_SYSTEM_NED = 1,
3960}
3961impl RtkBaselineCoordinateSystem {
3962 pub const DEFAULT: Self = Self::RTK_BASELINE_COORDINATE_SYSTEM_ECEF;
3963}
3964impl Default for RtkBaselineCoordinateSystem {
3965 fn default() -> Self {
3966 Self::DEFAULT
3967 }
3968}
3969#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3970#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3971#[cfg_attr(feature = "serde", serde(tag = "type"))]
3972#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3973#[repr(u32)]
3974#[doc = "Possible safety switch states."]
3975pub enum SafetySwitchState {
3976 #[doc = "Safety switch is engaged and vehicle should be safe to approach."]
3977 SAFETY_SWITCH_STATE_SAFE = 0,
3978 #[doc = "Safety switch is NOT engaged and motors, propellers and other actuators should be considered active."]
3979 SAFETY_SWITCH_STATE_DANGEROUS = 1,
3980}
3981impl SafetySwitchState {
3982 pub const DEFAULT: Self = Self::SAFETY_SWITCH_STATE_SAFE;
3983}
3984impl Default for SafetySwitchState {
3985 fn default() -> Self {
3986 Self::DEFAULT
3987 }
3988}
3989#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3990#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3991#[cfg_attr(feature = "serde", serde(tag = "type"))]
3992#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3993#[repr(u32)]
3994#[doc = "SERIAL_CONTROL device types"]
3995pub enum SerialControlDev {
3996 #[doc = "First telemetry port"]
3997 SERIAL_CONTROL_DEV_TELEM1 = 0,
3998 #[doc = "Second telemetry port"]
3999 SERIAL_CONTROL_DEV_TELEM2 = 1,
4000 #[doc = "First GPS port"]
4001 SERIAL_CONTROL_DEV_GPS1 = 2,
4002 #[doc = "Second GPS port"]
4003 SERIAL_CONTROL_DEV_GPS2 = 3,
4004 #[doc = "system shell"]
4005 SERIAL_CONTROL_DEV_SHELL = 10,
4006 #[doc = "SERIAL0"]
4007 SERIAL_CONTROL_SERIAL0 = 100,
4008 #[doc = "SERIAL1"]
4009 SERIAL_CONTROL_SERIAL1 = 101,
4010 #[doc = "SERIAL2"]
4011 SERIAL_CONTROL_SERIAL2 = 102,
4012 #[doc = "SERIAL3"]
4013 SERIAL_CONTROL_SERIAL3 = 103,
4014 #[doc = "SERIAL4"]
4015 SERIAL_CONTROL_SERIAL4 = 104,
4016 #[doc = "SERIAL5"]
4017 SERIAL_CONTROL_SERIAL5 = 105,
4018 #[doc = "SERIAL6"]
4019 SERIAL_CONTROL_SERIAL6 = 106,
4020 #[doc = "SERIAL7"]
4021 SERIAL_CONTROL_SERIAL7 = 107,
4022 #[doc = "SERIAL8"]
4023 SERIAL_CONTROL_SERIAL8 = 108,
4024 #[doc = "SERIAL9"]
4025 SERIAL_CONTROL_SERIAL9 = 109,
4026}
4027impl SerialControlDev {
4028 pub const DEFAULT: Self = Self::SERIAL_CONTROL_DEV_TELEM1;
4029}
4030impl Default for SerialControlDev {
4031 fn default() -> Self {
4032 Self::DEFAULT
4033 }
4034}
4035bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "SERIAL_CONTROL flags (bitmask)"] pub struct SerialControlFlag : u8 { # [doc = "Set if this is a reply"] const SERIAL_CONTROL_FLAG_REPLY = 1 ; # [doc = "Set if the sender wants the receiver to send a response as another SERIAL_CONTROL message"] const SERIAL_CONTROL_FLAG_RESPOND = 2 ; # [doc = "Set if access to the serial port should be removed from whatever driver is currently using it, giving exclusive access to the SERIAL_CONTROL protocol. The port can be handed back by sending a request without this flag set"] const SERIAL_CONTROL_FLAG_EXCLUSIVE = 4 ; # [doc = "Block on writes to the serial port"] const SERIAL_CONTROL_FLAG_BLOCKING = 8 ; # [doc = "Send multiple replies until port is drained"] const SERIAL_CONTROL_FLAG_MULTI = 16 ; } }
4036impl SerialControlFlag {
4037 pub const DEFAULT: Self = Self::SERIAL_CONTROL_FLAG_REPLY;
4038}
4039impl Default for SerialControlFlag {
4040 fn default() -> Self {
4041 Self::DEFAULT
4042 }
4043}
4044#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4045#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4046#[cfg_attr(feature = "serde", serde(tag = "type"))]
4047#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4048#[repr(u32)]
4049#[doc = "Focus types for MAV_CMD_SET_CAMERA_FOCUS"]
4050pub enum SetFocusType {
4051 #[doc = "Focus one step increment (-1 for focusing in, 1 for focusing out towards infinity)."]
4052 FOCUS_TYPE_STEP = 0,
4053 #[doc = "Continuous normalized focus in/out rate until stopped. Range -1..1, negative: in, positive: out towards infinity, 0 to stop focusing. Other values should be clipped to the range."]
4054 FOCUS_TYPE_CONTINUOUS = 1,
4055 #[doc = "Focus value as proportion of full camera focus range (a value between 0.0 and 100.0)"]
4056 FOCUS_TYPE_RANGE = 2,
4057 #[doc = "Focus value in metres. Note that there is no message to get the valid focus range of the camera, so this can type can only be used for cameras where the range is known (implying that this cannot reliably be used in a GCS for an arbitrary camera)."]
4058 FOCUS_TYPE_METERS = 3,
4059 #[doc = "Focus automatically."]
4060 FOCUS_TYPE_AUTO = 4,
4061 #[doc = "Single auto focus. Mainly used for still pictures. Usually abbreviated as AF-S."]
4062 FOCUS_TYPE_AUTO_SINGLE = 5,
4063 #[doc = "Continuous auto focus. Mainly used for dynamic scenes. Abbreviated as AF-C."]
4064 FOCUS_TYPE_AUTO_CONTINUOUS = 6,
4065}
4066impl SetFocusType {
4067 pub const DEFAULT: Self = Self::FOCUS_TYPE_STEP;
4068}
4069impl Default for SetFocusType {
4070 fn default() -> Self {
4071 Self::DEFAULT
4072 }
4073}
4074#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4075#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4076#[cfg_attr(feature = "serde", serde(tag = "type"))]
4077#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4078#[repr(u32)]
4079#[doc = "Speed setpoint types used in MAV_CMD_DO_CHANGE_SPEED"]
4080pub enum SpeedType {
4081 #[doc = "Airspeed"]
4082 SPEED_TYPE_AIRSPEED = 0,
4083 #[doc = "Groundspeed"]
4084 SPEED_TYPE_GROUNDSPEED = 1,
4085 #[doc = "Climb speed"]
4086 SPEED_TYPE_CLIMB_SPEED = 2,
4087 #[doc = "Descent speed"]
4088 SPEED_TYPE_DESCENT_SPEED = 3,
4089}
4090impl SpeedType {
4091 pub const DEFAULT: Self = Self::SPEED_TYPE_AIRSPEED;
4092}
4093impl Default for SpeedType {
4094 fn default() -> Self {
4095 Self::DEFAULT
4096 }
4097}
4098#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4099#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4100#[cfg_attr(feature = "serde", serde(tag = "type"))]
4101#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4102#[repr(u32)]
4103#[doc = "Flags to indicate the status of camera storage."]
4104pub enum StorageStatus {
4105 #[doc = "Storage is missing (no microSD card loaded for example.)"]
4106 STORAGE_STATUS_EMPTY = 0,
4107 #[doc = "Storage present but unformatted."]
4108 STORAGE_STATUS_UNFORMATTED = 1,
4109 #[doc = "Storage present and ready."]
4110 STORAGE_STATUS_READY = 2,
4111 #[doc = "Camera does not supply storage status information. Capacity information in STORAGE_INFORMATION fields will be ignored."]
4112 STORAGE_STATUS_NOT_SUPPORTED = 3,
4113}
4114impl StorageStatus {
4115 pub const DEFAULT: Self = Self::STORAGE_STATUS_EMPTY;
4116}
4117impl Default for StorageStatus {
4118 fn default() -> Self {
4119 Self::DEFAULT
4120 }
4121}
4122#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4123#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4124#[cfg_attr(feature = "serde", serde(tag = "type"))]
4125#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4126#[repr(u32)]
4127#[doc = "Flags to indicate the type of storage."]
4128pub enum StorageType {
4129 #[doc = "Storage type is not known."]
4130 STORAGE_TYPE_UNKNOWN = 0,
4131 #[doc = "Storage type is USB device."]
4132 STORAGE_TYPE_USB_STICK = 1,
4133 #[doc = "Storage type is SD card."]
4134 STORAGE_TYPE_SD = 2,
4135 #[doc = "Storage type is microSD card."]
4136 STORAGE_TYPE_MICROSD = 3,
4137 #[doc = "Storage type is CFast."]
4138 STORAGE_TYPE_CF = 4,
4139 #[doc = "Storage type is CFexpress."]
4140 STORAGE_TYPE_CFE = 5,
4141 #[doc = "Storage type is XQD."]
4142 STORAGE_TYPE_XQD = 6,
4143 #[doc = "Storage type is HD mass storage type."]
4144 STORAGE_TYPE_HD = 7,
4145 #[doc = "Storage type is other, not listed type."]
4146 STORAGE_TYPE_OTHER = 254,
4147}
4148impl StorageType {
4149 pub const DEFAULT: Self = Self::STORAGE_TYPE_UNKNOWN;
4150}
4151impl Default for StorageType {
4152 fn default() -> Self {
4153 Self::DEFAULT
4154 }
4155}
4156bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to indicate usage for a particular storage (see STORAGE_INFORMATION.storage_usage and MAV_CMD_SET_STORAGE_USAGE)."] pub struct StorageUsageFlag : u8 { # [doc = "Always set to 1 (indicates STORAGE_INFORMATION.storage_usage is supported)."] const STORAGE_USAGE_FLAG_SET = 1 ; # [doc = "Storage for saving photos."] const STORAGE_USAGE_FLAG_PHOTO = 2 ; # [doc = "Storage for saving videos."] const STORAGE_USAGE_FLAG_VIDEO = 4 ; # [doc = "Storage for saving logs."] const STORAGE_USAGE_FLAG_LOGS = 8 ; } }
4157impl StorageUsageFlag {
4158 pub const DEFAULT: Self = Self::STORAGE_USAGE_FLAG_SET;
4159}
4160impl Default for StorageUsageFlag {
4161 fn default() -> Self {
4162 Self::DEFAULT
4163 }
4164}
4165#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4166#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4167#[cfg_attr(feature = "serde", serde(tag = "type"))]
4168#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4169#[repr(u32)]
4170#[doc = "Tune formats (used for vehicle buzzer/tone generation)."]
4171pub enum TuneFormat {
4172 #[doc = "Format is QBasic 1.1 Play: <https://www.qbasic.net/en/reference/qb11/Statement/PLAY-006.htm>."]
4173 TUNE_FORMAT_QBASIC1_1 = 1,
4174 #[doc = "Format is Modern Music Markup Language (MML): <https://en.wikipedia.org/wiki/Music_Macro_Language#Modern_MML>."]
4175 TUNE_FORMAT_MML_MODERN = 2,
4176}
4177impl TuneFormat {
4178 pub const DEFAULT: Self = Self::TUNE_FORMAT_QBASIC1_1;
4179}
4180impl Default for TuneFormat {
4181 fn default() -> Self {
4182 Self::DEFAULT
4183 }
4184}
4185#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4186#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4187#[cfg_attr(feature = "serde", serde(tag = "type"))]
4188#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4189#[repr(u32)]
4190#[doc = "Generalized UAVCAN node health"]
4191pub enum UavcanNodeHealth {
4192 #[doc = "The node is functioning properly."]
4193 UAVCAN_NODE_HEALTH_OK = 0,
4194 #[doc = "A critical parameter went out of range or the node has encountered a minor failure."]
4195 UAVCAN_NODE_HEALTH_WARNING = 1,
4196 #[doc = "The node has encountered a major failure."]
4197 UAVCAN_NODE_HEALTH_ERROR = 2,
4198 #[doc = "The node has suffered a fatal malfunction."]
4199 UAVCAN_NODE_HEALTH_CRITICAL = 3,
4200}
4201impl UavcanNodeHealth {
4202 pub const DEFAULT: Self = Self::UAVCAN_NODE_HEALTH_OK;
4203}
4204impl Default for UavcanNodeHealth {
4205 fn default() -> Self {
4206 Self::DEFAULT
4207 }
4208}
4209#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4210#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4211#[cfg_attr(feature = "serde", serde(tag = "type"))]
4212#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4213#[repr(u32)]
4214#[doc = "Generalized UAVCAN node mode"]
4215pub enum UavcanNodeMode {
4216 #[doc = "The node is performing its primary functions."]
4217 UAVCAN_NODE_MODE_OPERATIONAL = 0,
4218 #[doc = "The node is initializing; this mode is entered immediately after startup."]
4219 UAVCAN_NODE_MODE_INITIALIZATION = 1,
4220 #[doc = "The node is under maintenance."]
4221 UAVCAN_NODE_MODE_MAINTENANCE = 2,
4222 #[doc = "The node is in the process of updating its software."]
4223 UAVCAN_NODE_MODE_SOFTWARE_UPDATE = 3,
4224 #[doc = "The node is no longer available online."]
4225 UAVCAN_NODE_MODE_OFFLINE = 7,
4226}
4227impl UavcanNodeMode {
4228 pub const DEFAULT: Self = Self::UAVCAN_NODE_MODE_OPERATIONAL;
4229}
4230impl Default for UavcanNodeMode {
4231 fn default() -> Self {
4232 Self::DEFAULT
4233 }
4234}
4235bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags for the global position report."] pub struct UtmDataAvailFlags : u8 { # [doc = "The field time contains valid data."] const UTM_DATA_AVAIL_FLAGS_TIME_VALID = 1 ; # [doc = "The field uas_id contains valid data."] const UTM_DATA_AVAIL_FLAGS_UAS_ID_AVAILABLE = 2 ; # [doc = "The fields lat, lon and h_acc contain valid data."] const UTM_DATA_AVAIL_FLAGS_POSITION_AVAILABLE = 4 ; # [doc = "The fields alt and v_acc contain valid data."] const UTM_DATA_AVAIL_FLAGS_ALTITUDE_AVAILABLE = 8 ; # [doc = "The field relative_alt contains valid data."] const UTM_DATA_AVAIL_FLAGS_RELATIVE_ALTITUDE_AVAILABLE = 16 ; # [doc = "The fields vx and vy contain valid data."] const UTM_DATA_AVAIL_FLAGS_HORIZONTAL_VELO_AVAILABLE = 32 ; # [doc = "The field vz contains valid data."] const UTM_DATA_AVAIL_FLAGS_VERTICAL_VELO_AVAILABLE = 64 ; # [doc = "The fields next_lat, next_lon and next_alt contain valid data."] const UTM_DATA_AVAIL_FLAGS_NEXT_WAYPOINT_AVAILABLE = 128 ; } }
4236impl UtmDataAvailFlags {
4237 pub const DEFAULT: Self = Self::UTM_DATA_AVAIL_FLAGS_TIME_VALID;
4238}
4239impl Default for UtmDataAvailFlags {
4240 fn default() -> Self {
4241 Self::DEFAULT
4242 }
4243}
4244#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4245#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4246#[cfg_attr(feature = "serde", serde(tag = "type"))]
4247#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4248#[repr(u32)]
4249#[doc = "Airborne status of UAS."]
4250pub enum UtmFlightState {
4251 #[doc = "The flight state can't be determined."]
4252 UTM_FLIGHT_STATE_UNKNOWN = 1,
4253 #[doc = "UAS on ground."]
4254 UTM_FLIGHT_STATE_GROUND = 2,
4255 #[doc = "UAS airborne."]
4256 UTM_FLIGHT_STATE_AIRBORNE = 3,
4257 #[doc = "UAS is in an emergency flight state."]
4258 UTM_FLIGHT_STATE_EMERGENCY = 16,
4259 #[doc = "UAS has no active controls."]
4260 UTM_FLIGHT_STATE_NOCTRL = 32,
4261}
4262impl UtmFlightState {
4263 pub const DEFAULT: Self = Self::UTM_FLIGHT_STATE_UNKNOWN;
4264}
4265impl Default for UtmFlightState {
4266 fn default() -> Self {
4267 Self::DEFAULT
4268 }
4269}
4270#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4271#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4272#[cfg_attr(feature = "serde", serde(tag = "type"))]
4273#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4274#[repr(u32)]
4275#[doc = "Video stream encodings"]
4276pub enum VideoStreamEncoding {
4277 #[doc = "Stream encoding is unknown"]
4278 VIDEO_STREAM_ENCODING_UNKNOWN = 0,
4279 #[doc = "Stream encoding is H.264"]
4280 VIDEO_STREAM_ENCODING_H264 = 1,
4281 #[doc = "Stream encoding is H.265"]
4282 VIDEO_STREAM_ENCODING_H265 = 2,
4283}
4284impl VideoStreamEncoding {
4285 pub const DEFAULT: Self = Self::VIDEO_STREAM_ENCODING_UNKNOWN;
4286}
4287impl Default for VideoStreamEncoding {
4288 fn default() -> Self {
4289 Self::DEFAULT
4290 }
4291}
4292bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Stream status flags (Bitmap)"] pub struct VideoStreamStatusFlags : u16 { # [doc = "Stream is active (running)"] const VIDEO_STREAM_STATUS_FLAGS_RUNNING = 1 ; # [doc = "Stream is thermal imaging"] const VIDEO_STREAM_STATUS_FLAGS_THERMAL = 2 ; # [doc = "Stream can report absolute thermal range (see CAMERA_THERMAL_RANGE)."] const VIDEO_STREAM_STATUS_FLAGS_THERMAL_RANGE_ENABLED = 4 ; } }
4293impl VideoStreamStatusFlags {
4294 pub const DEFAULT: Self = Self::VIDEO_STREAM_STATUS_FLAGS_RUNNING;
4295}
4296impl Default for VideoStreamStatusFlags {
4297 fn default() -> Self {
4298 Self::DEFAULT
4299 }
4300}
4301#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4302#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4303#[cfg_attr(feature = "serde", serde(tag = "type"))]
4304#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4305#[repr(u32)]
4306#[doc = "Video stream types"]
4307pub enum VideoStreamType {
4308 #[doc = "Stream is RTSP"]
4309 VIDEO_STREAM_TYPE_RTSP = 0,
4310 #[doc = "Stream is RTP UDP (URI gives the port number)"]
4311 VIDEO_STREAM_TYPE_RTPUDP = 1,
4312 #[doc = "Stream is MPEG on TCP"]
4313 VIDEO_STREAM_TYPE_TCP_MPEG = 2,
4314 #[doc = "Stream is MPEG TS (URI gives the port number)"]
4315 VIDEO_STREAM_TYPE_MPEG_TS = 3,
4316}
4317impl VideoStreamType {
4318 pub const DEFAULT: Self = Self::VIDEO_STREAM_TYPE_RTSP;
4319}
4320impl Default for VideoStreamType {
4321 fn default() -> Self {
4322 Self::DEFAULT
4323 }
4324}
4325#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4326#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4327#[cfg_attr(feature = "serde", serde(tag = "type"))]
4328#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4329#[repr(u32)]
4330#[doc = "Direction of VTOL transition"]
4331pub enum VtolTransitionHeading {
4332 #[doc = "Respect the heading configuration of the vehicle."]
4333 VTOL_TRANSITION_HEADING_VEHICLE_DEFAULT = 0,
4334 #[doc = "Use the heading pointing towards the next waypoint."]
4335 VTOL_TRANSITION_HEADING_NEXT_WAYPOINT = 1,
4336 #[doc = "Use the heading on takeoff (while sitting on the ground)."]
4337 VTOL_TRANSITION_HEADING_TAKEOFF = 2,
4338 #[doc = "Use the specified heading in parameter 4."]
4339 VTOL_TRANSITION_HEADING_SPECIFIED = 3,
4340 #[doc = "Use the current heading when reaching takeoff altitude (potentially facing the wind when weather-vaning is active)."]
4341 VTOL_TRANSITION_HEADING_ANY = 4,
4342}
4343impl VtolTransitionHeading {
4344 pub const DEFAULT: Self = Self::VTOL_TRANSITION_HEADING_VEHICLE_DEFAULT;
4345}
4346impl Default for VtolTransitionHeading {
4347 fn default() -> Self {
4348 Self::DEFAULT
4349 }
4350}
4351#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4352#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4353#[cfg_attr(feature = "serde", serde(tag = "type"))]
4354#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4355#[repr(u32)]
4356#[doc = "WiFi Mode."]
4357pub enum WifiConfigApMode {
4358 #[doc = "WiFi mode is undefined."]
4359 WIFI_CONFIG_AP_MODE_UNDEFINED = 0,
4360 #[doc = "WiFi configured as an access point."]
4361 WIFI_CONFIG_AP_MODE_AP = 1,
4362 #[doc = "WiFi configured as a station connected to an existing local WiFi network."]
4363 WIFI_CONFIG_AP_MODE_STATION = 2,
4364 #[doc = "WiFi disabled."]
4365 WIFI_CONFIG_AP_MODE_DISABLED = 3,
4366}
4367impl WifiConfigApMode {
4368 pub const DEFAULT: Self = Self::WIFI_CONFIG_AP_MODE_UNDEFINED;
4369}
4370impl Default for WifiConfigApMode {
4371 fn default() -> Self {
4372 Self::DEFAULT
4373 }
4374}
4375#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4376#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4377#[cfg_attr(feature = "serde", serde(tag = "type"))]
4378#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4379#[repr(u32)]
4380#[doc = "Possible responses from a WIFI_CONFIG_AP message."]
4381pub enum WifiConfigApResponse {
4382 #[doc = "Undefined response. Likely an indicative of a system that doesn't support this request."]
4383 WIFI_CONFIG_AP_RESPONSE_UNDEFINED = 0,
4384 #[doc = "Changes accepted."]
4385 WIFI_CONFIG_AP_RESPONSE_ACCEPTED = 1,
4386 #[doc = "Changes rejected."]
4387 WIFI_CONFIG_AP_RESPONSE_REJECTED = 2,
4388 #[doc = "Invalid Mode."]
4389 WIFI_CONFIG_AP_RESPONSE_MODE_ERROR = 3,
4390 #[doc = "Invalid SSID."]
4391 WIFI_CONFIG_AP_RESPONSE_SSID_ERROR = 4,
4392 #[doc = "Invalid Password."]
4393 WIFI_CONFIG_AP_RESPONSE_PASSWORD_ERROR = 5,
4394}
4395impl WifiConfigApResponse {
4396 pub const DEFAULT: Self = Self::WIFI_CONFIG_AP_RESPONSE_UNDEFINED;
4397}
4398impl Default for WifiConfigApResponse {
4399 fn default() -> Self {
4400 Self::DEFAULT
4401 }
4402}
4403#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4404#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4405#[cfg_attr(feature = "serde", serde(tag = "type"))]
4406#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4407#[repr(u32)]
4408#[doc = "Winch actions."]
4409pub enum WinchActions {
4410 #[doc = "Allow motor to freewheel."]
4411 WINCH_RELAXED = 0,
4412 #[doc = "Wind or unwind specified length of line, optionally using specified rate."]
4413 WINCH_RELATIVE_LENGTH_CONTROL = 1,
4414 #[doc = "Wind or unwind line at specified rate."]
4415 WINCH_RATE_CONTROL = 2,
4416 #[doc = "Perform the locking sequence to relieve motor while in the fully retracted position. Only action and instance command parameters are used, others are ignored."]
4417 WINCH_LOCK = 3,
4418 #[doc = "Sequence of drop, slow down, touch down, reel up, lock. Only action and instance command parameters are used, others are ignored."]
4419 WINCH_DELIVER = 4,
4420 #[doc = "Engage motor and hold current position. Only action and instance command parameters are used, others are ignored."]
4421 WINCH_HOLD = 5,
4422 #[doc = "Return the reel to the fully retracted position. Only action and instance command parameters are used, others are ignored."]
4423 WINCH_RETRACT = 6,
4424 #[doc = "Load the reel with line. The winch will calculate the total loaded length and stop when the tension exceeds a threshold. Only action and instance command parameters are used, others are ignored."]
4425 WINCH_LOAD_LINE = 7,
4426 #[doc = "Spool out the entire length of the line. Only action and instance command parameters are used, others are ignored."]
4427 WINCH_ABANDON_LINE = 8,
4428 #[doc = "Spools out just enough to present the hook to the user to load the payload. Only action and instance command parameters are used, others are ignored"]
4429 WINCH_LOAD_PAYLOAD = 9,
4430}
4431impl WinchActions {
4432 pub const DEFAULT: Self = Self::WINCH_RELAXED;
4433}
4434impl Default for WinchActions {
4435 fn default() -> Self {
4436 Self::DEFAULT
4437 }
4438}
4439#[doc = "id: 140"]
4440#[doc = "Set the vehicle attitude and body angular rates."]
4441#[derive(Debug, Clone, PartialEq)]
4442#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4443#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4444pub struct ACTUATOR_CONTROL_TARGET_DATA {
4445 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
4446 pub time_usec: u64,
4447 #[doc = "Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs."]
4448 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
4449 pub controls: [f32; 8],
4450 #[doc = "Actuator group. The \"_mlx\" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances."]
4451 pub group_mlx: u8,
4452}
4453impl ACTUATOR_CONTROL_TARGET_DATA {
4454 pub const ENCODED_LEN: usize = 41usize;
4455 pub const DEFAULT: Self = Self {
4456 time_usec: 0_u64,
4457 controls: [0.0_f32; 8usize],
4458 group_mlx: 0_u8,
4459 };
4460 #[cfg(feature = "arbitrary")]
4461 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
4462 use arbitrary::{Arbitrary, Unstructured};
4463 let mut buf = [0u8; 1024];
4464 rng.fill_bytes(&mut buf);
4465 let mut unstructured = Unstructured::new(&buf);
4466 Self::arbitrary(&mut unstructured).unwrap_or_default()
4467 }
4468}
4469impl Default for ACTUATOR_CONTROL_TARGET_DATA {
4470 fn default() -> Self {
4471 Self::DEFAULT.clone()
4472 }
4473}
4474impl MessageData for ACTUATOR_CONTROL_TARGET_DATA {
4475 type Message = MavMessage;
4476 const ID: u32 = 140u32;
4477 const NAME: &'static str = "ACTUATOR_CONTROL_TARGET";
4478 const EXTRA_CRC: u8 = 181u8;
4479 const ENCODED_LEN: usize = 41usize;
4480 fn deser(
4481 _version: MavlinkVersion,
4482 __input: &[u8],
4483 ) -> Result<Self, ::mavlink_core::error::ParserError> {
4484 let avail_len = __input.len();
4485 let mut payload_buf = [0; Self::ENCODED_LEN];
4486 let mut buf = if avail_len < Self::ENCODED_LEN {
4487 payload_buf[0..avail_len].copy_from_slice(__input);
4488 Bytes::new(&payload_buf)
4489 } else {
4490 Bytes::new(__input)
4491 };
4492 let mut __struct = Self::default();
4493 __struct.time_usec = buf.get_u64_le();
4494 for v in &mut __struct.controls {
4495 let val = buf.get_f32_le();
4496 *v = val;
4497 }
4498 __struct.group_mlx = buf.get_u8();
4499 Ok(__struct)
4500 }
4501 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
4502 let mut __tmp = BytesMut::new(bytes);
4503 #[allow(clippy::absurd_extreme_comparisons)]
4504 #[allow(unused_comparisons)]
4505 if __tmp.remaining() < Self::ENCODED_LEN {
4506 panic!(
4507 "buffer is too small (need {} bytes, but got {})",
4508 Self::ENCODED_LEN,
4509 __tmp.remaining(),
4510 )
4511 }
4512 __tmp.put_u64_le(self.time_usec);
4513 for val in &self.controls {
4514 __tmp.put_f32_le(*val);
4515 }
4516 __tmp.put_u8(self.group_mlx);
4517 if matches!(version, MavlinkVersion::V2) {
4518 let len = __tmp.len();
4519 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
4520 } else {
4521 __tmp.len()
4522 }
4523 }
4524}
4525#[doc = "id: 375"]
4526#[doc = "The raw values of the actuator outputs (e.g. on Pixhawk, from MAIN, AUX ports). This message supersedes SERVO_OUTPUT_RAW."]
4527#[derive(Debug, Clone, PartialEq)]
4528#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4529#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4530pub struct ACTUATOR_OUTPUT_STATUS_DATA {
4531 #[doc = "Timestamp (since system boot)."]
4532 pub time_usec: u64,
4533 #[doc = "Active outputs"]
4534 pub active: u32,
4535 #[doc = "Servo / motor output array values. Zero values indicate unused channels."]
4536 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
4537 pub actuator: [f32; 32],
4538}
4539impl ACTUATOR_OUTPUT_STATUS_DATA {
4540 pub const ENCODED_LEN: usize = 140usize;
4541 pub const DEFAULT: Self = Self {
4542 time_usec: 0_u64,
4543 active: 0_u32,
4544 actuator: [0.0_f32; 32usize],
4545 };
4546 #[cfg(feature = "arbitrary")]
4547 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
4548 use arbitrary::{Arbitrary, Unstructured};
4549 let mut buf = [0u8; 1024];
4550 rng.fill_bytes(&mut buf);
4551 let mut unstructured = Unstructured::new(&buf);
4552 Self::arbitrary(&mut unstructured).unwrap_or_default()
4553 }
4554}
4555impl Default for ACTUATOR_OUTPUT_STATUS_DATA {
4556 fn default() -> Self {
4557 Self::DEFAULT.clone()
4558 }
4559}
4560impl MessageData for ACTUATOR_OUTPUT_STATUS_DATA {
4561 type Message = MavMessage;
4562 const ID: u32 = 375u32;
4563 const NAME: &'static str = "ACTUATOR_OUTPUT_STATUS";
4564 const EXTRA_CRC: u8 = 251u8;
4565 const ENCODED_LEN: usize = 140usize;
4566 fn deser(
4567 _version: MavlinkVersion,
4568 __input: &[u8],
4569 ) -> Result<Self, ::mavlink_core::error::ParserError> {
4570 let avail_len = __input.len();
4571 let mut payload_buf = [0; Self::ENCODED_LEN];
4572 let mut buf = if avail_len < Self::ENCODED_LEN {
4573 payload_buf[0..avail_len].copy_from_slice(__input);
4574 Bytes::new(&payload_buf)
4575 } else {
4576 Bytes::new(__input)
4577 };
4578 let mut __struct = Self::default();
4579 __struct.time_usec = buf.get_u64_le();
4580 __struct.active = buf.get_u32_le();
4581 for v in &mut __struct.actuator {
4582 let val = buf.get_f32_le();
4583 *v = val;
4584 }
4585 Ok(__struct)
4586 }
4587 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
4588 let mut __tmp = BytesMut::new(bytes);
4589 #[allow(clippy::absurd_extreme_comparisons)]
4590 #[allow(unused_comparisons)]
4591 if __tmp.remaining() < Self::ENCODED_LEN {
4592 panic!(
4593 "buffer is too small (need {} bytes, but got {})",
4594 Self::ENCODED_LEN,
4595 __tmp.remaining(),
4596 )
4597 }
4598 __tmp.put_u64_le(self.time_usec);
4599 __tmp.put_u32_le(self.active);
4600 for val in &self.actuator {
4601 __tmp.put_f32_le(*val);
4602 }
4603 if matches!(version, MavlinkVersion::V2) {
4604 let len = __tmp.len();
4605 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
4606 } else {
4607 __tmp.len()
4608 }
4609 }
4610}
4611#[doc = "id: 246"]
4612#[doc = "The location and information of an ADSB vehicle."]
4613#[derive(Debug, Clone, PartialEq)]
4614#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4615#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4616pub struct ADSB_VEHICLE_DATA {
4617 #[doc = "ICAO address"]
4618 pub ICAO_address: u32,
4619 #[doc = "Latitude"]
4620 pub lat: i32,
4621 #[doc = "Longitude"]
4622 pub lon: i32,
4623 #[doc = "Altitude(ASL)"]
4624 pub altitude: i32,
4625 #[doc = "Course over ground"]
4626 pub heading: u16,
4627 #[doc = "The horizontal velocity"]
4628 pub hor_velocity: u16,
4629 #[doc = "The vertical velocity. Positive is up"]
4630 pub ver_velocity: i16,
4631 #[doc = "Bitmap to indicate various statuses including valid data fields"]
4632 pub flags: AdsbFlags,
4633 #[doc = "Squawk code. Note that the code is in decimal: e.g. 7700 (general emergency) is encoded as binary 0b0001_1110_0001_0100, not(!) as 0b0000_111_111_000_000"]
4634 pub squawk: u16,
4635 #[doc = "ADSB altitude type."]
4636 pub altitude_type: AdsbAltitudeType,
4637 #[doc = "The callsign, 8+null"]
4638 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
4639 pub callsign: [u8; 9],
4640 #[doc = "ADSB emitter type."]
4641 pub emitter_type: AdsbEmitterType,
4642 #[doc = "Time since last communication in seconds"]
4643 pub tslc: u8,
4644}
4645impl ADSB_VEHICLE_DATA {
4646 pub const ENCODED_LEN: usize = 38usize;
4647 pub const DEFAULT: Self = Self {
4648 ICAO_address: 0_u32,
4649 lat: 0_i32,
4650 lon: 0_i32,
4651 altitude: 0_i32,
4652 heading: 0_u16,
4653 hor_velocity: 0_u16,
4654 ver_velocity: 0_i16,
4655 flags: AdsbFlags::DEFAULT,
4656 squawk: 0_u16,
4657 altitude_type: AdsbAltitudeType::DEFAULT,
4658 callsign: [0_u8; 9usize],
4659 emitter_type: AdsbEmitterType::DEFAULT,
4660 tslc: 0_u8,
4661 };
4662 #[cfg(feature = "arbitrary")]
4663 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
4664 use arbitrary::{Arbitrary, Unstructured};
4665 let mut buf = [0u8; 1024];
4666 rng.fill_bytes(&mut buf);
4667 let mut unstructured = Unstructured::new(&buf);
4668 Self::arbitrary(&mut unstructured).unwrap_or_default()
4669 }
4670}
4671impl Default for ADSB_VEHICLE_DATA {
4672 fn default() -> Self {
4673 Self::DEFAULT.clone()
4674 }
4675}
4676impl MessageData for ADSB_VEHICLE_DATA {
4677 type Message = MavMessage;
4678 const ID: u32 = 246u32;
4679 const NAME: &'static str = "ADSB_VEHICLE";
4680 const EXTRA_CRC: u8 = 184u8;
4681 const ENCODED_LEN: usize = 38usize;
4682 fn deser(
4683 _version: MavlinkVersion,
4684 __input: &[u8],
4685 ) -> Result<Self, ::mavlink_core::error::ParserError> {
4686 let avail_len = __input.len();
4687 let mut payload_buf = [0; Self::ENCODED_LEN];
4688 let mut buf = if avail_len < Self::ENCODED_LEN {
4689 payload_buf[0..avail_len].copy_from_slice(__input);
4690 Bytes::new(&payload_buf)
4691 } else {
4692 Bytes::new(__input)
4693 };
4694 let mut __struct = Self::default();
4695 __struct.ICAO_address = buf.get_u32_le();
4696 __struct.lat = buf.get_i32_le();
4697 __struct.lon = buf.get_i32_le();
4698 __struct.altitude = buf.get_i32_le();
4699 __struct.heading = buf.get_u16_le();
4700 __struct.hor_velocity = buf.get_u16_le();
4701 __struct.ver_velocity = buf.get_i16_le();
4702 let tmp = buf.get_u16_le();
4703 __struct.flags = AdsbFlags::from_bits(tmp & AdsbFlags::all().bits()).ok_or(
4704 ::mavlink_core::error::ParserError::InvalidFlag {
4705 flag_type: "AdsbFlags",
4706 value: tmp as u32,
4707 },
4708 )?;
4709 __struct.squawk = buf.get_u16_le();
4710 let tmp = buf.get_u8();
4711 __struct.altitude_type =
4712 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
4713 enum_type: "AdsbAltitudeType",
4714 value: tmp as u32,
4715 })?;
4716 for v in &mut __struct.callsign {
4717 let val = buf.get_u8();
4718 *v = val;
4719 }
4720 let tmp = buf.get_u8();
4721 __struct.emitter_type =
4722 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
4723 enum_type: "AdsbEmitterType",
4724 value: tmp as u32,
4725 })?;
4726 __struct.tslc = buf.get_u8();
4727 Ok(__struct)
4728 }
4729 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
4730 let mut __tmp = BytesMut::new(bytes);
4731 #[allow(clippy::absurd_extreme_comparisons)]
4732 #[allow(unused_comparisons)]
4733 if __tmp.remaining() < Self::ENCODED_LEN {
4734 panic!(
4735 "buffer is too small (need {} bytes, but got {})",
4736 Self::ENCODED_LEN,
4737 __tmp.remaining(),
4738 )
4739 }
4740 __tmp.put_u32_le(self.ICAO_address);
4741 __tmp.put_i32_le(self.lat);
4742 __tmp.put_i32_le(self.lon);
4743 __tmp.put_i32_le(self.altitude);
4744 __tmp.put_u16_le(self.heading);
4745 __tmp.put_u16_le(self.hor_velocity);
4746 __tmp.put_i16_le(self.ver_velocity);
4747 __tmp.put_u16_le(self.flags.bits());
4748 __tmp.put_u16_le(self.squawk);
4749 __tmp.put_u8(self.altitude_type as u8);
4750 for val in &self.callsign {
4751 __tmp.put_u8(*val);
4752 }
4753 __tmp.put_u8(self.emitter_type as u8);
4754 __tmp.put_u8(self.tslc);
4755 if matches!(version, MavlinkVersion::V2) {
4756 let len = __tmp.len();
4757 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
4758 } else {
4759 __tmp.len()
4760 }
4761 }
4762}
4763#[doc = "id: 301"]
4764#[doc = "The location and information of an AIS vessel."]
4765#[derive(Debug, Clone, PartialEq)]
4766#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4767#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4768pub struct AIS_VESSEL_DATA {
4769 #[doc = "Mobile Marine Service Identifier, 9 decimal digits"]
4770 pub MMSI: u32,
4771 #[doc = "Latitude"]
4772 pub lat: i32,
4773 #[doc = "Longitude"]
4774 pub lon: i32,
4775 #[doc = "Course over ground"]
4776 pub COG: u16,
4777 #[doc = "True heading"]
4778 pub heading: u16,
4779 #[doc = "Speed over ground"]
4780 pub velocity: u16,
4781 #[doc = "Distance from lat/lon location to bow"]
4782 pub dimension_bow: u16,
4783 #[doc = "Distance from lat/lon location to stern"]
4784 pub dimension_stern: u16,
4785 #[doc = "Time since last communication in seconds"]
4786 pub tslc: u16,
4787 #[doc = "Bitmask to indicate various statuses including valid data fields"]
4788 pub flags: AisFlags,
4789 #[doc = "Turn rate"]
4790 pub turn_rate: i8,
4791 #[doc = "Navigational status"]
4792 pub navigational_status: AisNavStatus,
4793 #[doc = "Type of vessels"]
4794 pub mavtype: AisType,
4795 #[doc = "Distance from lat/lon location to port side"]
4796 pub dimension_port: u8,
4797 #[doc = "Distance from lat/lon location to starboard side"]
4798 pub dimension_starboard: u8,
4799 #[doc = "The vessel callsign"]
4800 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
4801 pub callsign: [u8; 7],
4802 #[doc = "The vessel name"]
4803 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
4804 pub name: [u8; 20],
4805}
4806impl AIS_VESSEL_DATA {
4807 pub const ENCODED_LEN: usize = 58usize;
4808 pub const DEFAULT: Self = Self {
4809 MMSI: 0_u32,
4810 lat: 0_i32,
4811 lon: 0_i32,
4812 COG: 0_u16,
4813 heading: 0_u16,
4814 velocity: 0_u16,
4815 dimension_bow: 0_u16,
4816 dimension_stern: 0_u16,
4817 tslc: 0_u16,
4818 flags: AisFlags::DEFAULT,
4819 turn_rate: 0_i8,
4820 navigational_status: AisNavStatus::DEFAULT,
4821 mavtype: AisType::DEFAULT,
4822 dimension_port: 0_u8,
4823 dimension_starboard: 0_u8,
4824 callsign: [0_u8; 7usize],
4825 name: [0_u8; 20usize],
4826 };
4827 #[cfg(feature = "arbitrary")]
4828 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
4829 use arbitrary::{Arbitrary, Unstructured};
4830 let mut buf = [0u8; 1024];
4831 rng.fill_bytes(&mut buf);
4832 let mut unstructured = Unstructured::new(&buf);
4833 Self::arbitrary(&mut unstructured).unwrap_or_default()
4834 }
4835}
4836impl Default for AIS_VESSEL_DATA {
4837 fn default() -> Self {
4838 Self::DEFAULT.clone()
4839 }
4840}
4841impl MessageData for AIS_VESSEL_DATA {
4842 type Message = MavMessage;
4843 const ID: u32 = 301u32;
4844 const NAME: &'static str = "AIS_VESSEL";
4845 const EXTRA_CRC: u8 = 243u8;
4846 const ENCODED_LEN: usize = 58usize;
4847 fn deser(
4848 _version: MavlinkVersion,
4849 __input: &[u8],
4850 ) -> Result<Self, ::mavlink_core::error::ParserError> {
4851 let avail_len = __input.len();
4852 let mut payload_buf = [0; Self::ENCODED_LEN];
4853 let mut buf = if avail_len < Self::ENCODED_LEN {
4854 payload_buf[0..avail_len].copy_from_slice(__input);
4855 Bytes::new(&payload_buf)
4856 } else {
4857 Bytes::new(__input)
4858 };
4859 let mut __struct = Self::default();
4860 __struct.MMSI = buf.get_u32_le();
4861 __struct.lat = buf.get_i32_le();
4862 __struct.lon = buf.get_i32_le();
4863 __struct.COG = buf.get_u16_le();
4864 __struct.heading = buf.get_u16_le();
4865 __struct.velocity = buf.get_u16_le();
4866 __struct.dimension_bow = buf.get_u16_le();
4867 __struct.dimension_stern = buf.get_u16_le();
4868 __struct.tslc = buf.get_u16_le();
4869 let tmp = buf.get_u16_le();
4870 __struct.flags = AisFlags::from_bits(tmp & AisFlags::all().bits()).ok_or(
4871 ::mavlink_core::error::ParserError::InvalidFlag {
4872 flag_type: "AisFlags",
4873 value: tmp as u32,
4874 },
4875 )?;
4876 __struct.turn_rate = buf.get_i8();
4877 let tmp = buf.get_u8();
4878 __struct.navigational_status =
4879 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
4880 enum_type: "AisNavStatus",
4881 value: tmp as u32,
4882 })?;
4883 let tmp = buf.get_u8();
4884 __struct.mavtype =
4885 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
4886 enum_type: "AisType",
4887 value: tmp as u32,
4888 })?;
4889 __struct.dimension_port = buf.get_u8();
4890 __struct.dimension_starboard = buf.get_u8();
4891 for v in &mut __struct.callsign {
4892 let val = buf.get_u8();
4893 *v = val;
4894 }
4895 for v in &mut __struct.name {
4896 let val = buf.get_u8();
4897 *v = val;
4898 }
4899 Ok(__struct)
4900 }
4901 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
4902 let mut __tmp = BytesMut::new(bytes);
4903 #[allow(clippy::absurd_extreme_comparisons)]
4904 #[allow(unused_comparisons)]
4905 if __tmp.remaining() < Self::ENCODED_LEN {
4906 panic!(
4907 "buffer is too small (need {} bytes, but got {})",
4908 Self::ENCODED_LEN,
4909 __tmp.remaining(),
4910 )
4911 }
4912 __tmp.put_u32_le(self.MMSI);
4913 __tmp.put_i32_le(self.lat);
4914 __tmp.put_i32_le(self.lon);
4915 __tmp.put_u16_le(self.COG);
4916 __tmp.put_u16_le(self.heading);
4917 __tmp.put_u16_le(self.velocity);
4918 __tmp.put_u16_le(self.dimension_bow);
4919 __tmp.put_u16_le(self.dimension_stern);
4920 __tmp.put_u16_le(self.tslc);
4921 __tmp.put_u16_le(self.flags.bits());
4922 __tmp.put_i8(self.turn_rate);
4923 __tmp.put_u8(self.navigational_status as u8);
4924 __tmp.put_u8(self.mavtype as u8);
4925 __tmp.put_u8(self.dimension_port);
4926 __tmp.put_u8(self.dimension_starboard);
4927 for val in &self.callsign {
4928 __tmp.put_u8(*val);
4929 }
4930 for val in &self.name {
4931 __tmp.put_u8(*val);
4932 }
4933 if matches!(version, MavlinkVersion::V2) {
4934 let len = __tmp.len();
4935 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
4936 } else {
4937 __tmp.len()
4938 }
4939 }
4940}
4941#[doc = "id: 141"]
4942#[doc = "The current system altitude."]
4943#[derive(Debug, Clone, PartialEq)]
4944#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4945#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4946pub struct ALTITUDE_DATA {
4947 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
4948 pub time_usec: u64,
4949 #[doc = "This altitude measure is initialized on system boot and monotonic (it is never reset, but represents the local altitude change). The only guarantee on this field is that it will never be reset and is consistent within a flight. The recommended value for this field is the uncorrected barometric altitude at boot time. This altitude will also drift and vary between flights."]
4950 pub altitude_monotonic: f32,
4951 #[doc = "This altitude measure is strictly above mean sea level and might be non-monotonic (it might reset on events like GPS lock or when a new QNH value is set). It should be the altitude to which global altitude waypoints are compared to. Note that it is *not* the GPS altitude, however, most GPS modules already output MSL by default and not the WGS84 altitude."]
4952 pub altitude_amsl: f32,
4953 #[doc = "This is the local altitude in the local coordinate frame. It is not the altitude above home, but in reference to the coordinate origin (0, 0, 0). It is up-positive."]
4954 pub altitude_local: f32,
4955 #[doc = "This is the altitude above the home position. It resets on each change of the current home position."]
4956 pub altitude_relative: f32,
4957 #[doc = "This is the altitude above terrain. It might be fed by a terrain database or an altimeter. Values smaller than -1000 should be interpreted as unknown."]
4958 pub altitude_terrain: f32,
4959 #[doc = "This is not the altitude, but the clear space below the system according to the fused clearance estimate. It generally should max out at the maximum range of e.g. the laser altimeter. It is generally a moving target. A negative value indicates no measurement available."]
4960 pub bottom_clearance: f32,
4961}
4962impl ALTITUDE_DATA {
4963 pub const ENCODED_LEN: usize = 32usize;
4964 pub const DEFAULT: Self = Self {
4965 time_usec: 0_u64,
4966 altitude_monotonic: 0.0_f32,
4967 altitude_amsl: 0.0_f32,
4968 altitude_local: 0.0_f32,
4969 altitude_relative: 0.0_f32,
4970 altitude_terrain: 0.0_f32,
4971 bottom_clearance: 0.0_f32,
4972 };
4973 #[cfg(feature = "arbitrary")]
4974 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
4975 use arbitrary::{Arbitrary, Unstructured};
4976 let mut buf = [0u8; 1024];
4977 rng.fill_bytes(&mut buf);
4978 let mut unstructured = Unstructured::new(&buf);
4979 Self::arbitrary(&mut unstructured).unwrap_or_default()
4980 }
4981}
4982impl Default for ALTITUDE_DATA {
4983 fn default() -> Self {
4984 Self::DEFAULT.clone()
4985 }
4986}
4987impl MessageData for ALTITUDE_DATA {
4988 type Message = MavMessage;
4989 const ID: u32 = 141u32;
4990 const NAME: &'static str = "ALTITUDE";
4991 const EXTRA_CRC: u8 = 47u8;
4992 const ENCODED_LEN: usize = 32usize;
4993 fn deser(
4994 _version: MavlinkVersion,
4995 __input: &[u8],
4996 ) -> Result<Self, ::mavlink_core::error::ParserError> {
4997 let avail_len = __input.len();
4998 let mut payload_buf = [0; Self::ENCODED_LEN];
4999 let mut buf = if avail_len < Self::ENCODED_LEN {
5000 payload_buf[0..avail_len].copy_from_slice(__input);
5001 Bytes::new(&payload_buf)
5002 } else {
5003 Bytes::new(__input)
5004 };
5005 let mut __struct = Self::default();
5006 __struct.time_usec = buf.get_u64_le();
5007 __struct.altitude_monotonic = buf.get_f32_le();
5008 __struct.altitude_amsl = buf.get_f32_le();
5009 __struct.altitude_local = buf.get_f32_le();
5010 __struct.altitude_relative = buf.get_f32_le();
5011 __struct.altitude_terrain = buf.get_f32_le();
5012 __struct.bottom_clearance = buf.get_f32_le();
5013 Ok(__struct)
5014 }
5015 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5016 let mut __tmp = BytesMut::new(bytes);
5017 #[allow(clippy::absurd_extreme_comparisons)]
5018 #[allow(unused_comparisons)]
5019 if __tmp.remaining() < Self::ENCODED_LEN {
5020 panic!(
5021 "buffer is too small (need {} bytes, but got {})",
5022 Self::ENCODED_LEN,
5023 __tmp.remaining(),
5024 )
5025 }
5026 __tmp.put_u64_le(self.time_usec);
5027 __tmp.put_f32_le(self.altitude_monotonic);
5028 __tmp.put_f32_le(self.altitude_amsl);
5029 __tmp.put_f32_le(self.altitude_local);
5030 __tmp.put_f32_le(self.altitude_relative);
5031 __tmp.put_f32_le(self.altitude_terrain);
5032 __tmp.put_f32_le(self.bottom_clearance);
5033 if matches!(version, MavlinkVersion::V2) {
5034 let len = __tmp.len();
5035 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5036 } else {
5037 __tmp.len()
5038 }
5039 }
5040}
5041#[doc = "id: 30"]
5042#[doc = "The attitude in the aeronautical frame (right-handed, Z-down, Y-right, X-front, ZYX, intrinsic)."]
5043#[derive(Debug, Clone, PartialEq)]
5044#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5045#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5046pub struct ATTITUDE_DATA {
5047 #[doc = "Timestamp (time since system boot)."]
5048 pub time_boot_ms: u32,
5049 #[doc = "Roll angle (-pi..+pi)"]
5050 pub roll: f32,
5051 #[doc = "Pitch angle (-pi..+pi)"]
5052 pub pitch: f32,
5053 #[doc = "Yaw angle (-pi..+pi)"]
5054 pub yaw: f32,
5055 #[doc = "Roll angular speed"]
5056 pub rollspeed: f32,
5057 #[doc = "Pitch angular speed"]
5058 pub pitchspeed: f32,
5059 #[doc = "Yaw angular speed"]
5060 pub yawspeed: f32,
5061}
5062impl ATTITUDE_DATA {
5063 pub const ENCODED_LEN: usize = 28usize;
5064 pub const DEFAULT: Self = Self {
5065 time_boot_ms: 0_u32,
5066 roll: 0.0_f32,
5067 pitch: 0.0_f32,
5068 yaw: 0.0_f32,
5069 rollspeed: 0.0_f32,
5070 pitchspeed: 0.0_f32,
5071 yawspeed: 0.0_f32,
5072 };
5073 #[cfg(feature = "arbitrary")]
5074 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5075 use arbitrary::{Arbitrary, Unstructured};
5076 let mut buf = [0u8; 1024];
5077 rng.fill_bytes(&mut buf);
5078 let mut unstructured = Unstructured::new(&buf);
5079 Self::arbitrary(&mut unstructured).unwrap_or_default()
5080 }
5081}
5082impl Default for ATTITUDE_DATA {
5083 fn default() -> Self {
5084 Self::DEFAULT.clone()
5085 }
5086}
5087impl MessageData for ATTITUDE_DATA {
5088 type Message = MavMessage;
5089 const ID: u32 = 30u32;
5090 const NAME: &'static str = "ATTITUDE";
5091 const EXTRA_CRC: u8 = 39u8;
5092 const ENCODED_LEN: usize = 28usize;
5093 fn deser(
5094 _version: MavlinkVersion,
5095 __input: &[u8],
5096 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5097 let avail_len = __input.len();
5098 let mut payload_buf = [0; Self::ENCODED_LEN];
5099 let mut buf = if avail_len < Self::ENCODED_LEN {
5100 payload_buf[0..avail_len].copy_from_slice(__input);
5101 Bytes::new(&payload_buf)
5102 } else {
5103 Bytes::new(__input)
5104 };
5105 let mut __struct = Self::default();
5106 __struct.time_boot_ms = buf.get_u32_le();
5107 __struct.roll = buf.get_f32_le();
5108 __struct.pitch = buf.get_f32_le();
5109 __struct.yaw = buf.get_f32_le();
5110 __struct.rollspeed = buf.get_f32_le();
5111 __struct.pitchspeed = buf.get_f32_le();
5112 __struct.yawspeed = buf.get_f32_le();
5113 Ok(__struct)
5114 }
5115 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5116 let mut __tmp = BytesMut::new(bytes);
5117 #[allow(clippy::absurd_extreme_comparisons)]
5118 #[allow(unused_comparisons)]
5119 if __tmp.remaining() < Self::ENCODED_LEN {
5120 panic!(
5121 "buffer is too small (need {} bytes, but got {})",
5122 Self::ENCODED_LEN,
5123 __tmp.remaining(),
5124 )
5125 }
5126 __tmp.put_u32_le(self.time_boot_ms);
5127 __tmp.put_f32_le(self.roll);
5128 __tmp.put_f32_le(self.pitch);
5129 __tmp.put_f32_le(self.yaw);
5130 __tmp.put_f32_le(self.rollspeed);
5131 __tmp.put_f32_le(self.pitchspeed);
5132 __tmp.put_f32_le(self.yawspeed);
5133 if matches!(version, MavlinkVersion::V2) {
5134 let len = __tmp.len();
5135 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5136 } else {
5137 __tmp.len()
5138 }
5139 }
5140}
5141#[doc = "id: 31"]
5142#[doc = "The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0)."]
5143#[derive(Debug, Clone, PartialEq)]
5144#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5145#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5146pub struct ATTITUDE_QUATERNION_DATA {
5147 #[doc = "Timestamp (time since system boot)."]
5148 pub time_boot_ms: u32,
5149 #[doc = "Quaternion component 1, w (1 in null-rotation)"]
5150 pub q1: f32,
5151 #[doc = "Quaternion component 2, x (0 in null-rotation)"]
5152 pub q2: f32,
5153 #[doc = "Quaternion component 3, y (0 in null-rotation)"]
5154 pub q3: f32,
5155 #[doc = "Quaternion component 4, z (0 in null-rotation)"]
5156 pub q4: f32,
5157 #[doc = "Roll angular speed"]
5158 pub rollspeed: f32,
5159 #[doc = "Pitch angular speed"]
5160 pub pitchspeed: f32,
5161 #[doc = "Yaw angular speed"]
5162 pub yawspeed: f32,
5163 #[doc = "Rotation offset by which the attitude quaternion and angular speed vector should be rotated for user display (quaternion with [w, x, y, z] order, zero-rotation is [1, 0, 0, 0], send [0, 0, 0, 0] if field not supported). This field is intended for systems in which the reference attitude may change during flight. For example, tailsitters VTOLs rotate their reference attitude by 90 degrees between hover mode and fixed wing mode, thus repr_offset_q is equal to [1, 0, 0, 0] in hover mode and equal to [0.7071, 0, 0.7071, 0] in fixed wing mode."]
5164 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
5165 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5166 pub repr_offset_q: [f32; 4],
5167}
5168impl ATTITUDE_QUATERNION_DATA {
5169 pub const ENCODED_LEN: usize = 48usize;
5170 pub const DEFAULT: Self = Self {
5171 time_boot_ms: 0_u32,
5172 q1: 0.0_f32,
5173 q2: 0.0_f32,
5174 q3: 0.0_f32,
5175 q4: 0.0_f32,
5176 rollspeed: 0.0_f32,
5177 pitchspeed: 0.0_f32,
5178 yawspeed: 0.0_f32,
5179 repr_offset_q: [0.0_f32; 4usize],
5180 };
5181 #[cfg(feature = "arbitrary")]
5182 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5183 use arbitrary::{Arbitrary, Unstructured};
5184 let mut buf = [0u8; 1024];
5185 rng.fill_bytes(&mut buf);
5186 let mut unstructured = Unstructured::new(&buf);
5187 Self::arbitrary(&mut unstructured).unwrap_or_default()
5188 }
5189}
5190impl Default for ATTITUDE_QUATERNION_DATA {
5191 fn default() -> Self {
5192 Self::DEFAULT.clone()
5193 }
5194}
5195impl MessageData for ATTITUDE_QUATERNION_DATA {
5196 type Message = MavMessage;
5197 const ID: u32 = 31u32;
5198 const NAME: &'static str = "ATTITUDE_QUATERNION";
5199 const EXTRA_CRC: u8 = 246u8;
5200 const ENCODED_LEN: usize = 48usize;
5201 fn deser(
5202 _version: MavlinkVersion,
5203 __input: &[u8],
5204 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5205 let avail_len = __input.len();
5206 let mut payload_buf = [0; Self::ENCODED_LEN];
5207 let mut buf = if avail_len < Self::ENCODED_LEN {
5208 payload_buf[0..avail_len].copy_from_slice(__input);
5209 Bytes::new(&payload_buf)
5210 } else {
5211 Bytes::new(__input)
5212 };
5213 let mut __struct = Self::default();
5214 __struct.time_boot_ms = buf.get_u32_le();
5215 __struct.q1 = buf.get_f32_le();
5216 __struct.q2 = buf.get_f32_le();
5217 __struct.q3 = buf.get_f32_le();
5218 __struct.q4 = buf.get_f32_le();
5219 __struct.rollspeed = buf.get_f32_le();
5220 __struct.pitchspeed = buf.get_f32_le();
5221 __struct.yawspeed = buf.get_f32_le();
5222 for v in &mut __struct.repr_offset_q {
5223 let val = buf.get_f32_le();
5224 *v = val;
5225 }
5226 Ok(__struct)
5227 }
5228 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5229 let mut __tmp = BytesMut::new(bytes);
5230 #[allow(clippy::absurd_extreme_comparisons)]
5231 #[allow(unused_comparisons)]
5232 if __tmp.remaining() < Self::ENCODED_LEN {
5233 panic!(
5234 "buffer is too small (need {} bytes, but got {})",
5235 Self::ENCODED_LEN,
5236 __tmp.remaining(),
5237 )
5238 }
5239 __tmp.put_u32_le(self.time_boot_ms);
5240 __tmp.put_f32_le(self.q1);
5241 __tmp.put_f32_le(self.q2);
5242 __tmp.put_f32_le(self.q3);
5243 __tmp.put_f32_le(self.q4);
5244 __tmp.put_f32_le(self.rollspeed);
5245 __tmp.put_f32_le(self.pitchspeed);
5246 __tmp.put_f32_le(self.yawspeed);
5247 for val in &self.repr_offset_q {
5248 __tmp.put_f32_le(*val);
5249 }
5250 if matches!(version, MavlinkVersion::V2) {
5251 let len = __tmp.len();
5252 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5253 } else {
5254 __tmp.len()
5255 }
5256 }
5257}
5258#[doc = "id: 61"]
5259#[doc = "The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0)."]
5260#[derive(Debug, Clone, PartialEq)]
5261#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5262#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5263pub struct ATTITUDE_QUATERNION_COV_DATA {
5264 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
5265 pub time_usec: u64,
5266 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation)"]
5267 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5268 pub q: [f32; 4],
5269 #[doc = "Roll angular speed"]
5270 pub rollspeed: f32,
5271 #[doc = "Pitch angular speed"]
5272 pub pitchspeed: f32,
5273 #[doc = "Yaw angular speed"]
5274 pub yawspeed: f32,
5275 #[doc = "Row-major representation of a 3x3 attitude covariance matrix (states: roll, pitch, yaw; first three entries are the first ROW, next three entries are the second row, etc.). If unknown, assign NaN value to first element in the array."]
5276 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5277 pub covariance: [f32; 9],
5278}
5279impl ATTITUDE_QUATERNION_COV_DATA {
5280 pub const ENCODED_LEN: usize = 72usize;
5281 pub const DEFAULT: Self = Self {
5282 time_usec: 0_u64,
5283 q: [0.0_f32; 4usize],
5284 rollspeed: 0.0_f32,
5285 pitchspeed: 0.0_f32,
5286 yawspeed: 0.0_f32,
5287 covariance: [0.0_f32; 9usize],
5288 };
5289 #[cfg(feature = "arbitrary")]
5290 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5291 use arbitrary::{Arbitrary, Unstructured};
5292 let mut buf = [0u8; 1024];
5293 rng.fill_bytes(&mut buf);
5294 let mut unstructured = Unstructured::new(&buf);
5295 Self::arbitrary(&mut unstructured).unwrap_or_default()
5296 }
5297}
5298impl Default for ATTITUDE_QUATERNION_COV_DATA {
5299 fn default() -> Self {
5300 Self::DEFAULT.clone()
5301 }
5302}
5303impl MessageData for ATTITUDE_QUATERNION_COV_DATA {
5304 type Message = MavMessage;
5305 const ID: u32 = 61u32;
5306 const NAME: &'static str = "ATTITUDE_QUATERNION_COV";
5307 const EXTRA_CRC: u8 = 167u8;
5308 const ENCODED_LEN: usize = 72usize;
5309 fn deser(
5310 _version: MavlinkVersion,
5311 __input: &[u8],
5312 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5313 let avail_len = __input.len();
5314 let mut payload_buf = [0; Self::ENCODED_LEN];
5315 let mut buf = if avail_len < Self::ENCODED_LEN {
5316 payload_buf[0..avail_len].copy_from_slice(__input);
5317 Bytes::new(&payload_buf)
5318 } else {
5319 Bytes::new(__input)
5320 };
5321 let mut __struct = Self::default();
5322 __struct.time_usec = buf.get_u64_le();
5323 for v in &mut __struct.q {
5324 let val = buf.get_f32_le();
5325 *v = val;
5326 }
5327 __struct.rollspeed = buf.get_f32_le();
5328 __struct.pitchspeed = buf.get_f32_le();
5329 __struct.yawspeed = buf.get_f32_le();
5330 for v in &mut __struct.covariance {
5331 let val = buf.get_f32_le();
5332 *v = val;
5333 }
5334 Ok(__struct)
5335 }
5336 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5337 let mut __tmp = BytesMut::new(bytes);
5338 #[allow(clippy::absurd_extreme_comparisons)]
5339 #[allow(unused_comparisons)]
5340 if __tmp.remaining() < Self::ENCODED_LEN {
5341 panic!(
5342 "buffer is too small (need {} bytes, but got {})",
5343 Self::ENCODED_LEN,
5344 __tmp.remaining(),
5345 )
5346 }
5347 __tmp.put_u64_le(self.time_usec);
5348 for val in &self.q {
5349 __tmp.put_f32_le(*val);
5350 }
5351 __tmp.put_f32_le(self.rollspeed);
5352 __tmp.put_f32_le(self.pitchspeed);
5353 __tmp.put_f32_le(self.yawspeed);
5354 for val in &self.covariance {
5355 __tmp.put_f32_le(*val);
5356 }
5357 if matches!(version, MavlinkVersion::V2) {
5358 let len = __tmp.len();
5359 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5360 } else {
5361 __tmp.len()
5362 }
5363 }
5364}
5365#[doc = "id: 83"]
5366#[doc = "Reports the current commanded attitude of the vehicle as specified by the autopilot. This should match the commands sent in a SET_ATTITUDE_TARGET message if the vehicle is being controlled this way."]
5367#[derive(Debug, Clone, PartialEq)]
5368#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5369#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5370pub struct ATTITUDE_TARGET_DATA {
5371 #[doc = "Timestamp (time since system boot)."]
5372 pub time_boot_ms: u32,
5373 #[doc = "Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
5374 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5375 pub q: [f32; 4],
5376 #[doc = "Body roll rate"]
5377 pub body_roll_rate: f32,
5378 #[doc = "Body pitch rate"]
5379 pub body_pitch_rate: f32,
5380 #[doc = "Body yaw rate"]
5381 pub body_yaw_rate: f32,
5382 #[doc = "Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust)"]
5383 pub thrust: f32,
5384 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
5385 pub type_mask: AttitudeTargetTypemask,
5386}
5387impl ATTITUDE_TARGET_DATA {
5388 pub const ENCODED_LEN: usize = 37usize;
5389 pub const DEFAULT: Self = Self {
5390 time_boot_ms: 0_u32,
5391 q: [0.0_f32; 4usize],
5392 body_roll_rate: 0.0_f32,
5393 body_pitch_rate: 0.0_f32,
5394 body_yaw_rate: 0.0_f32,
5395 thrust: 0.0_f32,
5396 type_mask: AttitudeTargetTypemask::DEFAULT,
5397 };
5398 #[cfg(feature = "arbitrary")]
5399 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5400 use arbitrary::{Arbitrary, Unstructured};
5401 let mut buf = [0u8; 1024];
5402 rng.fill_bytes(&mut buf);
5403 let mut unstructured = Unstructured::new(&buf);
5404 Self::arbitrary(&mut unstructured).unwrap_or_default()
5405 }
5406}
5407impl Default for ATTITUDE_TARGET_DATA {
5408 fn default() -> Self {
5409 Self::DEFAULT.clone()
5410 }
5411}
5412impl MessageData for ATTITUDE_TARGET_DATA {
5413 type Message = MavMessage;
5414 const ID: u32 = 83u32;
5415 const NAME: &'static str = "ATTITUDE_TARGET";
5416 const EXTRA_CRC: u8 = 22u8;
5417 const ENCODED_LEN: usize = 37usize;
5418 fn deser(
5419 _version: MavlinkVersion,
5420 __input: &[u8],
5421 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5422 let avail_len = __input.len();
5423 let mut payload_buf = [0; Self::ENCODED_LEN];
5424 let mut buf = if avail_len < Self::ENCODED_LEN {
5425 payload_buf[0..avail_len].copy_from_slice(__input);
5426 Bytes::new(&payload_buf)
5427 } else {
5428 Bytes::new(__input)
5429 };
5430 let mut __struct = Self::default();
5431 __struct.time_boot_ms = buf.get_u32_le();
5432 for v in &mut __struct.q {
5433 let val = buf.get_f32_le();
5434 *v = val;
5435 }
5436 __struct.body_roll_rate = buf.get_f32_le();
5437 __struct.body_pitch_rate = buf.get_f32_le();
5438 __struct.body_yaw_rate = buf.get_f32_le();
5439 __struct.thrust = buf.get_f32_le();
5440 let tmp = buf.get_u8();
5441 __struct.type_mask = AttitudeTargetTypemask::from_bits(
5442 tmp & AttitudeTargetTypemask::all().bits(),
5443 )
5444 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
5445 flag_type: "AttitudeTargetTypemask",
5446 value: tmp as u32,
5447 })?;
5448 Ok(__struct)
5449 }
5450 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5451 let mut __tmp = BytesMut::new(bytes);
5452 #[allow(clippy::absurd_extreme_comparisons)]
5453 #[allow(unused_comparisons)]
5454 if __tmp.remaining() < Self::ENCODED_LEN {
5455 panic!(
5456 "buffer is too small (need {} bytes, but got {})",
5457 Self::ENCODED_LEN,
5458 __tmp.remaining(),
5459 )
5460 }
5461 __tmp.put_u32_le(self.time_boot_ms);
5462 for val in &self.q {
5463 __tmp.put_f32_le(*val);
5464 }
5465 __tmp.put_f32_le(self.body_roll_rate);
5466 __tmp.put_f32_le(self.body_pitch_rate);
5467 __tmp.put_f32_le(self.body_yaw_rate);
5468 __tmp.put_f32_le(self.thrust);
5469 __tmp.put_u8(self.type_mask.bits());
5470 if matches!(version, MavlinkVersion::V2) {
5471 let len = __tmp.len();
5472 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5473 } else {
5474 __tmp.len()
5475 }
5476 }
5477}
5478#[doc = "id: 138"]
5479#[doc = "Motion capture attitude and position."]
5480#[derive(Debug, Clone, PartialEq)]
5481#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5482#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5483pub struct ATT_POS_MOCAP_DATA {
5484 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
5485 pub time_usec: u64,
5486 #[doc = "Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
5487 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5488 pub q: [f32; 4],
5489 #[doc = "X position (NED)"]
5490 pub x: f32,
5491 #[doc = "Y position (NED)"]
5492 pub y: f32,
5493 #[doc = "Z position (NED)"]
5494 pub z: f32,
5495 #[doc = "Row-major representation of a pose 6x6 cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
5496 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
5497 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5498 pub covariance: [f32; 21],
5499}
5500impl ATT_POS_MOCAP_DATA {
5501 pub const ENCODED_LEN: usize = 120usize;
5502 pub const DEFAULT: Self = Self {
5503 time_usec: 0_u64,
5504 q: [0.0_f32; 4usize],
5505 x: 0.0_f32,
5506 y: 0.0_f32,
5507 z: 0.0_f32,
5508 covariance: [0.0_f32; 21usize],
5509 };
5510 #[cfg(feature = "arbitrary")]
5511 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5512 use arbitrary::{Arbitrary, Unstructured};
5513 let mut buf = [0u8; 1024];
5514 rng.fill_bytes(&mut buf);
5515 let mut unstructured = Unstructured::new(&buf);
5516 Self::arbitrary(&mut unstructured).unwrap_or_default()
5517 }
5518}
5519impl Default for ATT_POS_MOCAP_DATA {
5520 fn default() -> Self {
5521 Self::DEFAULT.clone()
5522 }
5523}
5524impl MessageData for ATT_POS_MOCAP_DATA {
5525 type Message = MavMessage;
5526 const ID: u32 = 138u32;
5527 const NAME: &'static str = "ATT_POS_MOCAP";
5528 const EXTRA_CRC: u8 = 109u8;
5529 const ENCODED_LEN: usize = 120usize;
5530 fn deser(
5531 _version: MavlinkVersion,
5532 __input: &[u8],
5533 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5534 let avail_len = __input.len();
5535 let mut payload_buf = [0; Self::ENCODED_LEN];
5536 let mut buf = if avail_len < Self::ENCODED_LEN {
5537 payload_buf[0..avail_len].copy_from_slice(__input);
5538 Bytes::new(&payload_buf)
5539 } else {
5540 Bytes::new(__input)
5541 };
5542 let mut __struct = Self::default();
5543 __struct.time_usec = buf.get_u64_le();
5544 for v in &mut __struct.q {
5545 let val = buf.get_f32_le();
5546 *v = val;
5547 }
5548 __struct.x = buf.get_f32_le();
5549 __struct.y = buf.get_f32_le();
5550 __struct.z = buf.get_f32_le();
5551 for v in &mut __struct.covariance {
5552 let val = buf.get_f32_le();
5553 *v = val;
5554 }
5555 Ok(__struct)
5556 }
5557 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5558 let mut __tmp = BytesMut::new(bytes);
5559 #[allow(clippy::absurd_extreme_comparisons)]
5560 #[allow(unused_comparisons)]
5561 if __tmp.remaining() < Self::ENCODED_LEN {
5562 panic!(
5563 "buffer is too small (need {} bytes, but got {})",
5564 Self::ENCODED_LEN,
5565 __tmp.remaining(),
5566 )
5567 }
5568 __tmp.put_u64_le(self.time_usec);
5569 for val in &self.q {
5570 __tmp.put_f32_le(*val);
5571 }
5572 __tmp.put_f32_le(self.x);
5573 __tmp.put_f32_le(self.y);
5574 __tmp.put_f32_le(self.z);
5575 for val in &self.covariance {
5576 __tmp.put_f32_le(*val);
5577 }
5578 if matches!(version, MavlinkVersion::V2) {
5579 let len = __tmp.len();
5580 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5581 } else {
5582 __tmp.len()
5583 }
5584 }
5585}
5586#[doc = "id: 7"]
5587#[doc = "Emit an encrypted signature / key identifying this system. PLEASE NOTE: This protocol has been kept simple, so transmitting the key requires an encrypted channel for true safety."]
5588#[derive(Debug, Clone, PartialEq)]
5589#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5590#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5591pub struct AUTH_KEY_DATA {
5592 #[doc = "key"]
5593 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5594 pub key: [u8; 32],
5595}
5596impl AUTH_KEY_DATA {
5597 pub const ENCODED_LEN: usize = 32usize;
5598 pub const DEFAULT: Self = Self {
5599 key: [0_u8; 32usize],
5600 };
5601 #[cfg(feature = "arbitrary")]
5602 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5603 use arbitrary::{Arbitrary, Unstructured};
5604 let mut buf = [0u8; 1024];
5605 rng.fill_bytes(&mut buf);
5606 let mut unstructured = Unstructured::new(&buf);
5607 Self::arbitrary(&mut unstructured).unwrap_or_default()
5608 }
5609}
5610impl Default for AUTH_KEY_DATA {
5611 fn default() -> Self {
5612 Self::DEFAULT.clone()
5613 }
5614}
5615impl MessageData for AUTH_KEY_DATA {
5616 type Message = MavMessage;
5617 const ID: u32 = 7u32;
5618 const NAME: &'static str = "AUTH_KEY";
5619 const EXTRA_CRC: u8 = 119u8;
5620 const ENCODED_LEN: usize = 32usize;
5621 fn deser(
5622 _version: MavlinkVersion,
5623 __input: &[u8],
5624 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5625 let avail_len = __input.len();
5626 let mut payload_buf = [0; Self::ENCODED_LEN];
5627 let mut buf = if avail_len < Self::ENCODED_LEN {
5628 payload_buf[0..avail_len].copy_from_slice(__input);
5629 Bytes::new(&payload_buf)
5630 } else {
5631 Bytes::new(__input)
5632 };
5633 let mut __struct = Self::default();
5634 for v in &mut __struct.key {
5635 let val = buf.get_u8();
5636 *v = val;
5637 }
5638 Ok(__struct)
5639 }
5640 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5641 let mut __tmp = BytesMut::new(bytes);
5642 #[allow(clippy::absurd_extreme_comparisons)]
5643 #[allow(unused_comparisons)]
5644 if __tmp.remaining() < Self::ENCODED_LEN {
5645 panic!(
5646 "buffer is too small (need {} bytes, but got {})",
5647 Self::ENCODED_LEN,
5648 __tmp.remaining(),
5649 )
5650 }
5651 for val in &self.key {
5652 __tmp.put_u8(*val);
5653 }
5654 if matches!(version, MavlinkVersion::V2) {
5655 let len = __tmp.len();
5656 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5657 } else {
5658 __tmp.len()
5659 }
5660 }
5661}
5662#[doc = "id: 286"]
5663#[doc = "Low level message containing autopilot state relevant for a gimbal device. This message is to be sent from the autopilot to the gimbal device component. The data of this message are for the gimbal device's estimator corrections, in particular horizon compensation, as well as indicates autopilot control intentions, e.g. feed forward angular control in the z-axis."]
5664#[derive(Debug, Clone, PartialEq)]
5665#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5666#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5667pub struct AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
5668 #[doc = "Timestamp (time since system boot)."]
5669 pub time_boot_us: u64,
5670 #[doc = "Quaternion components of autopilot attitude: w, x, y, z (1 0 0 0 is the null-rotation, Hamilton convention)."]
5671 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5672 pub q: [f32; 4],
5673 #[doc = "Estimated delay of the attitude data. 0 if unknown."]
5674 pub q_estimated_delay_us: u32,
5675 #[doc = "X Speed in NED (North, East, Down). NAN if unknown."]
5676 pub vx: f32,
5677 #[doc = "Y Speed in NED (North, East, Down). NAN if unknown."]
5678 pub vy: f32,
5679 #[doc = "Z Speed in NED (North, East, Down). NAN if unknown."]
5680 pub vz: f32,
5681 #[doc = "Estimated delay of the speed data. 0 if unknown."]
5682 pub v_estimated_delay_us: u32,
5683 #[doc = "Feed forward Z component of angular velocity (positive: yawing to the right). NaN to be ignored. This is to indicate if the autopilot is actively yawing."]
5684 pub feed_forward_angular_velocity_z: f32,
5685 #[doc = "Bitmap indicating which estimator outputs are valid."]
5686 pub estimator_status: EstimatorStatusFlags,
5687 #[doc = "System ID"]
5688 pub target_system: u8,
5689 #[doc = "Component ID"]
5690 pub target_component: u8,
5691 #[doc = "The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown."]
5692 pub landed_state: MavLandedState,
5693 #[doc = "Z component of angular velocity in NED (North, East, Down). NaN if unknown."]
5694 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
5695 pub angular_velocity_z: f32,
5696}
5697impl AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
5698 pub const ENCODED_LEN: usize = 57usize;
5699 pub const DEFAULT: Self = Self {
5700 time_boot_us: 0_u64,
5701 q: [0.0_f32; 4usize],
5702 q_estimated_delay_us: 0_u32,
5703 vx: 0.0_f32,
5704 vy: 0.0_f32,
5705 vz: 0.0_f32,
5706 v_estimated_delay_us: 0_u32,
5707 feed_forward_angular_velocity_z: 0.0_f32,
5708 estimator_status: EstimatorStatusFlags::DEFAULT,
5709 target_system: 0_u8,
5710 target_component: 0_u8,
5711 landed_state: MavLandedState::DEFAULT,
5712 angular_velocity_z: 0.0_f32,
5713 };
5714 #[cfg(feature = "arbitrary")]
5715 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5716 use arbitrary::{Arbitrary, Unstructured};
5717 let mut buf = [0u8; 1024];
5718 rng.fill_bytes(&mut buf);
5719 let mut unstructured = Unstructured::new(&buf);
5720 Self::arbitrary(&mut unstructured).unwrap_or_default()
5721 }
5722}
5723impl Default for AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
5724 fn default() -> Self {
5725 Self::DEFAULT.clone()
5726 }
5727}
5728impl MessageData for AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
5729 type Message = MavMessage;
5730 const ID: u32 = 286u32;
5731 const NAME: &'static str = "AUTOPILOT_STATE_FOR_GIMBAL_DEVICE";
5732 const EXTRA_CRC: u8 = 210u8;
5733 const ENCODED_LEN: usize = 57usize;
5734 fn deser(
5735 _version: MavlinkVersion,
5736 __input: &[u8],
5737 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5738 let avail_len = __input.len();
5739 let mut payload_buf = [0; Self::ENCODED_LEN];
5740 let mut buf = if avail_len < Self::ENCODED_LEN {
5741 payload_buf[0..avail_len].copy_from_slice(__input);
5742 Bytes::new(&payload_buf)
5743 } else {
5744 Bytes::new(__input)
5745 };
5746 let mut __struct = Self::default();
5747 __struct.time_boot_us = buf.get_u64_le();
5748 for v in &mut __struct.q {
5749 let val = buf.get_f32_le();
5750 *v = val;
5751 }
5752 __struct.q_estimated_delay_us = buf.get_u32_le();
5753 __struct.vx = buf.get_f32_le();
5754 __struct.vy = buf.get_f32_le();
5755 __struct.vz = buf.get_f32_le();
5756 __struct.v_estimated_delay_us = buf.get_u32_le();
5757 __struct.feed_forward_angular_velocity_z = buf.get_f32_le();
5758 let tmp = buf.get_u16_le();
5759 __struct.estimator_status = EstimatorStatusFlags::from_bits(
5760 tmp & EstimatorStatusFlags::all().bits(),
5761 )
5762 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
5763 flag_type: "EstimatorStatusFlags",
5764 value: tmp as u32,
5765 })?;
5766 __struct.target_system = buf.get_u8();
5767 __struct.target_component = buf.get_u8();
5768 let tmp = buf.get_u8();
5769 __struct.landed_state =
5770 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
5771 enum_type: "MavLandedState",
5772 value: tmp as u32,
5773 })?;
5774 __struct.angular_velocity_z = buf.get_f32_le();
5775 Ok(__struct)
5776 }
5777 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5778 let mut __tmp = BytesMut::new(bytes);
5779 #[allow(clippy::absurd_extreme_comparisons)]
5780 #[allow(unused_comparisons)]
5781 if __tmp.remaining() < Self::ENCODED_LEN {
5782 panic!(
5783 "buffer is too small (need {} bytes, but got {})",
5784 Self::ENCODED_LEN,
5785 __tmp.remaining(),
5786 )
5787 }
5788 __tmp.put_u64_le(self.time_boot_us);
5789 for val in &self.q {
5790 __tmp.put_f32_le(*val);
5791 }
5792 __tmp.put_u32_le(self.q_estimated_delay_us);
5793 __tmp.put_f32_le(self.vx);
5794 __tmp.put_f32_le(self.vy);
5795 __tmp.put_f32_le(self.vz);
5796 __tmp.put_u32_le(self.v_estimated_delay_us);
5797 __tmp.put_f32_le(self.feed_forward_angular_velocity_z);
5798 __tmp.put_u16_le(self.estimator_status.bits());
5799 __tmp.put_u8(self.target_system);
5800 __tmp.put_u8(self.target_component);
5801 __tmp.put_u8(self.landed_state as u8);
5802 __tmp.put_f32_le(self.angular_velocity_z);
5803 if matches!(version, MavlinkVersion::V2) {
5804 let len = __tmp.len();
5805 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5806 } else {
5807 __tmp.len()
5808 }
5809 }
5810}
5811#[doc = "id: 148"]
5812#[doc = "Version and capability of autopilot software. This should be emitted in response to a request with MAV_CMD_REQUEST_MESSAGE."]
5813#[derive(Debug, Clone, PartialEq)]
5814#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5815#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5816pub struct AUTOPILOT_VERSION_DATA {
5817 #[doc = "Bitmap of capabilities"]
5818 pub capabilities: MavProtocolCapability,
5819 #[doc = "UID if provided by hardware (see uid2)"]
5820 pub uid: u64,
5821 #[doc = "Firmware version number. The field must be encoded as 4 bytes, where each byte (shown from MSB to LSB) is part of a semantic version: (major) (minor) (patch) (FIRMWARE_VERSION_TYPE)."]
5822 pub flight_sw_version: u32,
5823 #[doc = "Middleware version number"]
5824 pub middleware_sw_version: u32,
5825 #[doc = "Operating system version number"]
5826 pub os_sw_version: u32,
5827 #[doc = "HW / board version (last 8 bits should be silicon ID, if any). The first 16 bits of this field specify <https://github.com/PX4/PX4-Bootloader/blob/master/board_types.txt>"]
5828 pub board_version: u32,
5829 #[doc = "ID of the board vendor"]
5830 pub vendor_id: u16,
5831 #[doc = "ID of the product"]
5832 pub product_id: u16,
5833 #[doc = "Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases."]
5834 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5835 pub flight_custom_version: [u8; 8],
5836 #[doc = "Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases."]
5837 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5838 pub middleware_custom_version: [u8; 8],
5839 #[doc = "Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases."]
5840 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5841 pub os_custom_version: [u8; 8],
5842 #[doc = "UID if provided by hardware (supersedes the uid field. If this is non-zero, use this field, otherwise use uid)"]
5843 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
5844 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5845 pub uid2: [u8; 18],
5846}
5847impl AUTOPILOT_VERSION_DATA {
5848 pub const ENCODED_LEN: usize = 78usize;
5849 pub const DEFAULT: Self = Self {
5850 capabilities: MavProtocolCapability::DEFAULT,
5851 uid: 0_u64,
5852 flight_sw_version: 0_u32,
5853 middleware_sw_version: 0_u32,
5854 os_sw_version: 0_u32,
5855 board_version: 0_u32,
5856 vendor_id: 0_u16,
5857 product_id: 0_u16,
5858 flight_custom_version: [0_u8; 8usize],
5859 middleware_custom_version: [0_u8; 8usize],
5860 os_custom_version: [0_u8; 8usize],
5861 uid2: [0_u8; 18usize],
5862 };
5863 #[cfg(feature = "arbitrary")]
5864 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5865 use arbitrary::{Arbitrary, Unstructured};
5866 let mut buf = [0u8; 1024];
5867 rng.fill_bytes(&mut buf);
5868 let mut unstructured = Unstructured::new(&buf);
5869 Self::arbitrary(&mut unstructured).unwrap_or_default()
5870 }
5871}
5872impl Default for AUTOPILOT_VERSION_DATA {
5873 fn default() -> Self {
5874 Self::DEFAULT.clone()
5875 }
5876}
5877impl MessageData for AUTOPILOT_VERSION_DATA {
5878 type Message = MavMessage;
5879 const ID: u32 = 148u32;
5880 const NAME: &'static str = "AUTOPILOT_VERSION";
5881 const EXTRA_CRC: u8 = 178u8;
5882 const ENCODED_LEN: usize = 78usize;
5883 fn deser(
5884 _version: MavlinkVersion,
5885 __input: &[u8],
5886 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5887 let avail_len = __input.len();
5888 let mut payload_buf = [0; Self::ENCODED_LEN];
5889 let mut buf = if avail_len < Self::ENCODED_LEN {
5890 payload_buf[0..avail_len].copy_from_slice(__input);
5891 Bytes::new(&payload_buf)
5892 } else {
5893 Bytes::new(__input)
5894 };
5895 let mut __struct = Self::default();
5896 let tmp = buf.get_u64_le();
5897 __struct.capabilities = MavProtocolCapability::from_bits(
5898 tmp & MavProtocolCapability::all().bits(),
5899 )
5900 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
5901 flag_type: "MavProtocolCapability",
5902 value: tmp as u32,
5903 })?;
5904 __struct.uid = buf.get_u64_le();
5905 __struct.flight_sw_version = buf.get_u32_le();
5906 __struct.middleware_sw_version = buf.get_u32_le();
5907 __struct.os_sw_version = buf.get_u32_le();
5908 __struct.board_version = buf.get_u32_le();
5909 __struct.vendor_id = buf.get_u16_le();
5910 __struct.product_id = buf.get_u16_le();
5911 for v in &mut __struct.flight_custom_version {
5912 let val = buf.get_u8();
5913 *v = val;
5914 }
5915 for v in &mut __struct.middleware_custom_version {
5916 let val = buf.get_u8();
5917 *v = val;
5918 }
5919 for v in &mut __struct.os_custom_version {
5920 let val = buf.get_u8();
5921 *v = val;
5922 }
5923 for v in &mut __struct.uid2 {
5924 let val = buf.get_u8();
5925 *v = val;
5926 }
5927 Ok(__struct)
5928 }
5929 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5930 let mut __tmp = BytesMut::new(bytes);
5931 #[allow(clippy::absurd_extreme_comparisons)]
5932 #[allow(unused_comparisons)]
5933 if __tmp.remaining() < Self::ENCODED_LEN {
5934 panic!(
5935 "buffer is too small (need {} bytes, but got {})",
5936 Self::ENCODED_LEN,
5937 __tmp.remaining(),
5938 )
5939 }
5940 __tmp.put_u64_le(self.capabilities.bits());
5941 __tmp.put_u64_le(self.uid);
5942 __tmp.put_u32_le(self.flight_sw_version);
5943 __tmp.put_u32_le(self.middleware_sw_version);
5944 __tmp.put_u32_le(self.os_sw_version);
5945 __tmp.put_u32_le(self.board_version);
5946 __tmp.put_u16_le(self.vendor_id);
5947 __tmp.put_u16_le(self.product_id);
5948 for val in &self.flight_custom_version {
5949 __tmp.put_u8(*val);
5950 }
5951 for val in &self.middleware_custom_version {
5952 __tmp.put_u8(*val);
5953 }
5954 for val in &self.os_custom_version {
5955 __tmp.put_u8(*val);
5956 }
5957 for val in &self.uid2 {
5958 __tmp.put_u8(*val);
5959 }
5960 if matches!(version, MavlinkVersion::V2) {
5961 let len = __tmp.len();
5962 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5963 } else {
5964 __tmp.len()
5965 }
5966 }
5967}
5968#[doc = "id: 435"]
5969#[doc = "Information about a flight mode. The message can be enumerated to get information for all modes, or requested for a particular mode, using MAV_CMD_REQUEST_MESSAGE. Specify 0 in param2 to request that the message is emitted for all available modes or the specific index for just one mode. The modes must be available/settable for the current vehicle/frame type. Each mode should only be emitted once (even if it is both standard and custom). Note that the current mode should be emitted in CURRENT_MODE, and that if the mode list can change then AVAILABLE_MODES_MONITOR must be emitted on first change and subsequently streamed. See <https://mavlink.io/en/services/standard_modes.html>."]
5970#[derive(Debug, Clone, PartialEq)]
5971#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5972#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5973pub struct AVAILABLE_MODES_DATA {
5974 #[doc = "A bitfield for use for autopilot-specific flags"]
5975 pub custom_mode: u32,
5976 #[doc = "Mode properties."]
5977 pub properties: MavModeProperty,
5978 #[doc = "The total number of available modes for the current vehicle type."]
5979 pub number_modes: u8,
5980 #[doc = "The current mode index within number_modes, indexed from 1. The index is not guaranteed to be persistent, and may change between reboots or if the set of modes change."]
5981 pub mode_index: u8,
5982 #[doc = "Standard mode."]
5983 pub standard_mode: MavStandardMode,
5984 #[doc = "Name of custom mode, with null termination character. Should be omitted for standard modes."]
5985 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5986 pub mode_name: [u8; 35],
5987}
5988impl AVAILABLE_MODES_DATA {
5989 pub const ENCODED_LEN: usize = 46usize;
5990 pub const DEFAULT: Self = Self {
5991 custom_mode: 0_u32,
5992 properties: MavModeProperty::DEFAULT,
5993 number_modes: 0_u8,
5994 mode_index: 0_u8,
5995 standard_mode: MavStandardMode::DEFAULT,
5996 mode_name: [0_u8; 35usize],
5997 };
5998 #[cfg(feature = "arbitrary")]
5999 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6000 use arbitrary::{Arbitrary, Unstructured};
6001 let mut buf = [0u8; 1024];
6002 rng.fill_bytes(&mut buf);
6003 let mut unstructured = Unstructured::new(&buf);
6004 Self::arbitrary(&mut unstructured).unwrap_or_default()
6005 }
6006}
6007impl Default for AVAILABLE_MODES_DATA {
6008 fn default() -> Self {
6009 Self::DEFAULT.clone()
6010 }
6011}
6012impl MessageData for AVAILABLE_MODES_DATA {
6013 type Message = MavMessage;
6014 const ID: u32 = 435u32;
6015 const NAME: &'static str = "AVAILABLE_MODES";
6016 const EXTRA_CRC: u8 = 134u8;
6017 const ENCODED_LEN: usize = 46usize;
6018 fn deser(
6019 _version: MavlinkVersion,
6020 __input: &[u8],
6021 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6022 let avail_len = __input.len();
6023 let mut payload_buf = [0; Self::ENCODED_LEN];
6024 let mut buf = if avail_len < Self::ENCODED_LEN {
6025 payload_buf[0..avail_len].copy_from_slice(__input);
6026 Bytes::new(&payload_buf)
6027 } else {
6028 Bytes::new(__input)
6029 };
6030 let mut __struct = Self::default();
6031 __struct.custom_mode = buf.get_u32_le();
6032 let tmp = buf.get_u32_le();
6033 __struct.properties = MavModeProperty::from_bits(tmp & MavModeProperty::all().bits())
6034 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
6035 flag_type: "MavModeProperty",
6036 value: tmp as u32,
6037 })?;
6038 __struct.number_modes = buf.get_u8();
6039 __struct.mode_index = buf.get_u8();
6040 let tmp = buf.get_u8();
6041 __struct.standard_mode =
6042 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6043 enum_type: "MavStandardMode",
6044 value: tmp as u32,
6045 })?;
6046 for v in &mut __struct.mode_name {
6047 let val = buf.get_u8();
6048 *v = val;
6049 }
6050 Ok(__struct)
6051 }
6052 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6053 let mut __tmp = BytesMut::new(bytes);
6054 #[allow(clippy::absurd_extreme_comparisons)]
6055 #[allow(unused_comparisons)]
6056 if __tmp.remaining() < Self::ENCODED_LEN {
6057 panic!(
6058 "buffer is too small (need {} bytes, but got {})",
6059 Self::ENCODED_LEN,
6060 __tmp.remaining(),
6061 )
6062 }
6063 __tmp.put_u32_le(self.custom_mode);
6064 __tmp.put_u32_le(self.properties.bits());
6065 __tmp.put_u8(self.number_modes);
6066 __tmp.put_u8(self.mode_index);
6067 __tmp.put_u8(self.standard_mode as u8);
6068 for val in &self.mode_name {
6069 __tmp.put_u8(*val);
6070 }
6071 if matches!(version, MavlinkVersion::V2) {
6072 let len = __tmp.len();
6073 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6074 } else {
6075 __tmp.len()
6076 }
6077 }
6078}
6079#[doc = "id: 437"]
6080#[doc = "A change to the sequence number indicates that the set of AVAILABLE_MODES has changed. A receiver must re-request all available modes whenever the sequence number changes. This is only emitted after the first change and should then be broadcast at low rate (nominally 0.3 Hz) and on change. See <https://mavlink.io/en/services/standard_modes.html>."]
6081#[derive(Debug, Clone, PartialEq)]
6082#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6083#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6084pub struct AVAILABLE_MODES_MONITOR_DATA {
6085 #[doc = "Sequence number. The value iterates sequentially whenever AVAILABLE_MODES changes (e.g. support for a new mode is added/removed dynamically)."]
6086 pub seq: u8,
6087}
6088impl AVAILABLE_MODES_MONITOR_DATA {
6089 pub const ENCODED_LEN: usize = 1usize;
6090 pub const DEFAULT: Self = Self { seq: 0_u8 };
6091 #[cfg(feature = "arbitrary")]
6092 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6093 use arbitrary::{Arbitrary, Unstructured};
6094 let mut buf = [0u8; 1024];
6095 rng.fill_bytes(&mut buf);
6096 let mut unstructured = Unstructured::new(&buf);
6097 Self::arbitrary(&mut unstructured).unwrap_or_default()
6098 }
6099}
6100impl Default for AVAILABLE_MODES_MONITOR_DATA {
6101 fn default() -> Self {
6102 Self::DEFAULT.clone()
6103 }
6104}
6105impl MessageData for AVAILABLE_MODES_MONITOR_DATA {
6106 type Message = MavMessage;
6107 const ID: u32 = 437u32;
6108 const NAME: &'static str = "AVAILABLE_MODES_MONITOR";
6109 const EXTRA_CRC: u8 = 30u8;
6110 const ENCODED_LEN: usize = 1usize;
6111 fn deser(
6112 _version: MavlinkVersion,
6113 __input: &[u8],
6114 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6115 let avail_len = __input.len();
6116 let mut payload_buf = [0; Self::ENCODED_LEN];
6117 let mut buf = if avail_len < Self::ENCODED_LEN {
6118 payload_buf[0..avail_len].copy_from_slice(__input);
6119 Bytes::new(&payload_buf)
6120 } else {
6121 Bytes::new(__input)
6122 };
6123 let mut __struct = Self::default();
6124 __struct.seq = buf.get_u8();
6125 Ok(__struct)
6126 }
6127 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6128 let mut __tmp = BytesMut::new(bytes);
6129 #[allow(clippy::absurd_extreme_comparisons)]
6130 #[allow(unused_comparisons)]
6131 if __tmp.remaining() < Self::ENCODED_LEN {
6132 panic!(
6133 "buffer is too small (need {} bytes, but got {})",
6134 Self::ENCODED_LEN,
6135 __tmp.remaining(),
6136 )
6137 }
6138 __tmp.put_u8(self.seq);
6139 if matches!(version, MavlinkVersion::V2) {
6140 let len = __tmp.len();
6141 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6142 } else {
6143 __tmp.len()
6144 }
6145 }
6146}
6147#[doc = "id: 372"]
6148#[doc = "Battery information that is static, or requires infrequent update. This message should requested using MAV_CMD_REQUEST_MESSAGE and/or streamed at very low rate. BATTERY_STATUS_V2 is used for higher-rate battery status information."]
6149#[derive(Debug, Clone, PartialEq)]
6150#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6151#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6152pub struct BATTERY_INFO_DATA {
6153 #[doc = "Minimum per-cell voltage when discharging. 0: field not provided."]
6154 pub discharge_minimum_voltage: f32,
6155 #[doc = "Minimum per-cell voltage when charging. 0: field not provided."]
6156 pub charging_minimum_voltage: f32,
6157 #[doc = "Minimum per-cell voltage when resting. 0: field not provided."]
6158 pub resting_minimum_voltage: f32,
6159 #[doc = "Maximum per-cell voltage when charged. 0: field not provided."]
6160 pub charging_maximum_voltage: f32,
6161 #[doc = "Maximum pack continuous charge current. 0: field not provided."]
6162 pub charging_maximum_current: f32,
6163 #[doc = "Battery nominal voltage. Used for conversion between Wh and Ah. 0: field not provided."]
6164 pub nominal_voltage: f32,
6165 #[doc = "Maximum pack discharge current. 0: field not provided."]
6166 pub discharge_maximum_current: f32,
6167 #[doc = "Maximum pack discharge burst current. 0: field not provided."]
6168 pub discharge_maximum_burst_current: f32,
6169 #[doc = "Fully charged design capacity. 0: field not provided."]
6170 pub design_capacity: f32,
6171 #[doc = "Predicted battery capacity when fully charged (accounting for battery degradation). NAN: field not provided."]
6172 pub full_charge_capacity: f32,
6173 #[doc = "Lifetime count of the number of charge/discharge cycles (<https://en.wikipedia.org/wiki/Charge_cycle>). UINT16_MAX: field not provided."]
6174 pub cycle_count: u16,
6175 #[doc = "Battery weight. 0: field not provided."]
6176 pub weight: u16,
6177 #[doc = "Battery ID"]
6178 pub id: u8,
6179 #[doc = "Function of the battery."]
6180 pub battery_function: MavBatteryFunction,
6181 #[doc = "Type (chemistry) of the battery."]
6182 pub mavtype: MavBatteryType,
6183 #[doc = "State of Health (SOH) estimate. Typically 100% at the time of manufacture and will decrease over time and use. -1: field not provided."]
6184 pub state_of_health: u8,
6185 #[doc = "Number of battery cells in series. 0: field not provided."]
6186 pub cells_in_series: u8,
6187 #[doc = "Manufacture date (DDMMYYYY) in ASCII characters, 0 terminated. All 0: field not provided."]
6188 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6189 pub manufacture_date: [u8; 9],
6190 #[doc = "Serial number in ASCII characters, 0 terminated. All 0: field not provided."]
6191 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6192 pub serial_number: [u8; 32],
6193 #[doc = "Battery device name. Formatted as manufacturer name then product name, separated with an underscore (in ASCII characters), 0 terminated. All 0: field not provided."]
6194 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6195 pub name: [u8; 50],
6196}
6197impl BATTERY_INFO_DATA {
6198 pub const ENCODED_LEN: usize = 140usize;
6199 pub const DEFAULT: Self = Self {
6200 discharge_minimum_voltage: 0.0_f32,
6201 charging_minimum_voltage: 0.0_f32,
6202 resting_minimum_voltage: 0.0_f32,
6203 charging_maximum_voltage: 0.0_f32,
6204 charging_maximum_current: 0.0_f32,
6205 nominal_voltage: 0.0_f32,
6206 discharge_maximum_current: 0.0_f32,
6207 discharge_maximum_burst_current: 0.0_f32,
6208 design_capacity: 0.0_f32,
6209 full_charge_capacity: 0.0_f32,
6210 cycle_count: 0_u16,
6211 weight: 0_u16,
6212 id: 0_u8,
6213 battery_function: MavBatteryFunction::DEFAULT,
6214 mavtype: MavBatteryType::DEFAULT,
6215 state_of_health: 0_u8,
6216 cells_in_series: 0_u8,
6217 manufacture_date: [0_u8; 9usize],
6218 serial_number: [0_u8; 32usize],
6219 name: [0_u8; 50usize],
6220 };
6221 #[cfg(feature = "arbitrary")]
6222 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6223 use arbitrary::{Arbitrary, Unstructured};
6224 let mut buf = [0u8; 1024];
6225 rng.fill_bytes(&mut buf);
6226 let mut unstructured = Unstructured::new(&buf);
6227 Self::arbitrary(&mut unstructured).unwrap_or_default()
6228 }
6229}
6230impl Default for BATTERY_INFO_DATA {
6231 fn default() -> Self {
6232 Self::DEFAULT.clone()
6233 }
6234}
6235impl MessageData for BATTERY_INFO_DATA {
6236 type Message = MavMessage;
6237 const ID: u32 = 372u32;
6238 const NAME: &'static str = "BATTERY_INFO";
6239 const EXTRA_CRC: u8 = 26u8;
6240 const ENCODED_LEN: usize = 140usize;
6241 fn deser(
6242 _version: MavlinkVersion,
6243 __input: &[u8],
6244 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6245 let avail_len = __input.len();
6246 let mut payload_buf = [0; Self::ENCODED_LEN];
6247 let mut buf = if avail_len < Self::ENCODED_LEN {
6248 payload_buf[0..avail_len].copy_from_slice(__input);
6249 Bytes::new(&payload_buf)
6250 } else {
6251 Bytes::new(__input)
6252 };
6253 let mut __struct = Self::default();
6254 __struct.discharge_minimum_voltage = buf.get_f32_le();
6255 __struct.charging_minimum_voltage = buf.get_f32_le();
6256 __struct.resting_minimum_voltage = buf.get_f32_le();
6257 __struct.charging_maximum_voltage = buf.get_f32_le();
6258 __struct.charging_maximum_current = buf.get_f32_le();
6259 __struct.nominal_voltage = buf.get_f32_le();
6260 __struct.discharge_maximum_current = buf.get_f32_le();
6261 __struct.discharge_maximum_burst_current = buf.get_f32_le();
6262 __struct.design_capacity = buf.get_f32_le();
6263 __struct.full_charge_capacity = buf.get_f32_le();
6264 __struct.cycle_count = buf.get_u16_le();
6265 __struct.weight = buf.get_u16_le();
6266 __struct.id = buf.get_u8();
6267 let tmp = buf.get_u8();
6268 __struct.battery_function =
6269 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6270 enum_type: "MavBatteryFunction",
6271 value: tmp as u32,
6272 })?;
6273 let tmp = buf.get_u8();
6274 __struct.mavtype =
6275 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6276 enum_type: "MavBatteryType",
6277 value: tmp as u32,
6278 })?;
6279 __struct.state_of_health = buf.get_u8();
6280 __struct.cells_in_series = buf.get_u8();
6281 for v in &mut __struct.manufacture_date {
6282 let val = buf.get_u8();
6283 *v = val;
6284 }
6285 for v in &mut __struct.serial_number {
6286 let val = buf.get_u8();
6287 *v = val;
6288 }
6289 for v in &mut __struct.name {
6290 let val = buf.get_u8();
6291 *v = val;
6292 }
6293 Ok(__struct)
6294 }
6295 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6296 let mut __tmp = BytesMut::new(bytes);
6297 #[allow(clippy::absurd_extreme_comparisons)]
6298 #[allow(unused_comparisons)]
6299 if __tmp.remaining() < Self::ENCODED_LEN {
6300 panic!(
6301 "buffer is too small (need {} bytes, but got {})",
6302 Self::ENCODED_LEN,
6303 __tmp.remaining(),
6304 )
6305 }
6306 __tmp.put_f32_le(self.discharge_minimum_voltage);
6307 __tmp.put_f32_le(self.charging_minimum_voltage);
6308 __tmp.put_f32_le(self.resting_minimum_voltage);
6309 __tmp.put_f32_le(self.charging_maximum_voltage);
6310 __tmp.put_f32_le(self.charging_maximum_current);
6311 __tmp.put_f32_le(self.nominal_voltage);
6312 __tmp.put_f32_le(self.discharge_maximum_current);
6313 __tmp.put_f32_le(self.discharge_maximum_burst_current);
6314 __tmp.put_f32_le(self.design_capacity);
6315 __tmp.put_f32_le(self.full_charge_capacity);
6316 __tmp.put_u16_le(self.cycle_count);
6317 __tmp.put_u16_le(self.weight);
6318 __tmp.put_u8(self.id);
6319 __tmp.put_u8(self.battery_function as u8);
6320 __tmp.put_u8(self.mavtype as u8);
6321 __tmp.put_u8(self.state_of_health);
6322 __tmp.put_u8(self.cells_in_series);
6323 for val in &self.manufacture_date {
6324 __tmp.put_u8(*val);
6325 }
6326 for val in &self.serial_number {
6327 __tmp.put_u8(*val);
6328 }
6329 for val in &self.name {
6330 __tmp.put_u8(*val);
6331 }
6332 if matches!(version, MavlinkVersion::V2) {
6333 let len = __tmp.len();
6334 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6335 } else {
6336 __tmp.len()
6337 }
6338 }
6339}
6340#[doc = "id: 147"]
6341#[doc = "Battery information. Updates GCS with flight controller battery status. Smart batteries also use this message, but may additionally send BATTERY_INFO."]
6342#[derive(Debug, Clone, PartialEq)]
6343#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6344#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6345pub struct BATTERY_STATUS_DATA {
6346 #[doc = "Consumed charge, -1: autopilot does not provide consumption estimate"]
6347 pub current_consumed: i32,
6348 #[doc = "Consumed energy, -1: autopilot does not provide energy consumption estimate"]
6349 pub energy_consumed: i32,
6350 #[doc = "Temperature of the battery. INT16_MAX for unknown temperature."]
6351 pub temperature: i16,
6352 #[doc = "Battery voltage of cells 1 to 10 (see voltages_ext for cells 11-14). Cells in this field above the valid cell count for this battery should have the UINT16_MAX value. If individual cell voltages are unknown or not measured for this battery, then the overall battery voltage should be filled in cell 0, with all others set to UINT16_MAX. If the voltage of the battery is greater than (UINT16_MAX - 1), then cell 0 should be set to (UINT16_MAX - 1), and cell 1 to the remaining voltage. This can be extended to multiple cells if the total voltage is greater than 2 * (UINT16_MAX - 1)."]
6353 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6354 pub voltages: [u16; 10],
6355 #[doc = "Battery current, -1: autopilot does not measure the current"]
6356 pub current_battery: i16,
6357 #[doc = "Battery ID"]
6358 pub id: u8,
6359 #[doc = "Function of the battery"]
6360 pub battery_function: MavBatteryFunction,
6361 #[doc = "Type (chemistry) of the battery"]
6362 pub mavtype: MavBatteryType,
6363 #[doc = "Remaining battery energy. Values: [0-100], -1: autopilot does not estimate the remaining battery."]
6364 pub battery_remaining: i8,
6365 #[doc = "Remaining battery time, 0: autopilot does not provide remaining battery time estimate"]
6366 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6367 pub time_remaining: i32,
6368 #[doc = "State for extent of discharge, provided by autopilot for warning or external reactions"]
6369 #[cfg_attr(feature = "serde", serde(default))]
6370 pub charge_state: MavBatteryChargeState,
6371 #[doc = "Battery voltages for cells 11 to 14. Cells above the valid cell count for this battery should have a value of 0, where zero indicates not supported (note, this is different than for the voltages field and allows empty byte truncation). If the measured value is 0 then 1 should be sent instead."]
6372 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6373 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6374 pub voltages_ext: [u16; 4],
6375 #[doc = "Battery mode. Default (0) is that battery mode reporting is not supported or battery is in normal-use mode."]
6376 #[cfg_attr(feature = "serde", serde(default))]
6377 pub mode: MavBatteryMode,
6378 #[doc = "Fault/health indications. These should be set when charge_state is MAV_BATTERY_CHARGE_STATE_FAILED or MAV_BATTERY_CHARGE_STATE_UNHEALTHY (if not, fault reporting is not supported)."]
6379 #[cfg_attr(feature = "serde", serde(default))]
6380 pub fault_bitmask: MavBatteryFault,
6381}
6382impl BATTERY_STATUS_DATA {
6383 pub const ENCODED_LEN: usize = 54usize;
6384 pub const DEFAULT: Self = Self {
6385 current_consumed: 0_i32,
6386 energy_consumed: 0_i32,
6387 temperature: 0_i16,
6388 voltages: [0_u16; 10usize],
6389 current_battery: 0_i16,
6390 id: 0_u8,
6391 battery_function: MavBatteryFunction::DEFAULT,
6392 mavtype: MavBatteryType::DEFAULT,
6393 battery_remaining: 0_i8,
6394 time_remaining: 0_i32,
6395 charge_state: MavBatteryChargeState::DEFAULT,
6396 voltages_ext: [0_u16; 4usize],
6397 mode: MavBatteryMode::DEFAULT,
6398 fault_bitmask: MavBatteryFault::DEFAULT,
6399 };
6400 #[cfg(feature = "arbitrary")]
6401 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6402 use arbitrary::{Arbitrary, Unstructured};
6403 let mut buf = [0u8; 1024];
6404 rng.fill_bytes(&mut buf);
6405 let mut unstructured = Unstructured::new(&buf);
6406 Self::arbitrary(&mut unstructured).unwrap_or_default()
6407 }
6408}
6409impl Default for BATTERY_STATUS_DATA {
6410 fn default() -> Self {
6411 Self::DEFAULT.clone()
6412 }
6413}
6414impl MessageData for BATTERY_STATUS_DATA {
6415 type Message = MavMessage;
6416 const ID: u32 = 147u32;
6417 const NAME: &'static str = "BATTERY_STATUS";
6418 const EXTRA_CRC: u8 = 154u8;
6419 const ENCODED_LEN: usize = 54usize;
6420 fn deser(
6421 _version: MavlinkVersion,
6422 __input: &[u8],
6423 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6424 let avail_len = __input.len();
6425 let mut payload_buf = [0; Self::ENCODED_LEN];
6426 let mut buf = if avail_len < Self::ENCODED_LEN {
6427 payload_buf[0..avail_len].copy_from_slice(__input);
6428 Bytes::new(&payload_buf)
6429 } else {
6430 Bytes::new(__input)
6431 };
6432 let mut __struct = Self::default();
6433 __struct.current_consumed = buf.get_i32_le();
6434 __struct.energy_consumed = buf.get_i32_le();
6435 __struct.temperature = buf.get_i16_le();
6436 for v in &mut __struct.voltages {
6437 let val = buf.get_u16_le();
6438 *v = val;
6439 }
6440 __struct.current_battery = buf.get_i16_le();
6441 __struct.id = buf.get_u8();
6442 let tmp = buf.get_u8();
6443 __struct.battery_function =
6444 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6445 enum_type: "MavBatteryFunction",
6446 value: tmp as u32,
6447 })?;
6448 let tmp = buf.get_u8();
6449 __struct.mavtype =
6450 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6451 enum_type: "MavBatteryType",
6452 value: tmp as u32,
6453 })?;
6454 __struct.battery_remaining = buf.get_i8();
6455 __struct.time_remaining = buf.get_i32_le();
6456 let tmp = buf.get_u8();
6457 __struct.charge_state =
6458 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6459 enum_type: "MavBatteryChargeState",
6460 value: tmp as u32,
6461 })?;
6462 for v in &mut __struct.voltages_ext {
6463 let val = buf.get_u16_le();
6464 *v = val;
6465 }
6466 let tmp = buf.get_u8();
6467 __struct.mode =
6468 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6469 enum_type: "MavBatteryMode",
6470 value: tmp as u32,
6471 })?;
6472 let tmp = buf.get_u32_le();
6473 __struct.fault_bitmask = MavBatteryFault::from_bits(tmp & MavBatteryFault::all().bits())
6474 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
6475 flag_type: "MavBatteryFault",
6476 value: tmp as u32,
6477 })?;
6478 Ok(__struct)
6479 }
6480 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6481 let mut __tmp = BytesMut::new(bytes);
6482 #[allow(clippy::absurd_extreme_comparisons)]
6483 #[allow(unused_comparisons)]
6484 if __tmp.remaining() < Self::ENCODED_LEN {
6485 panic!(
6486 "buffer is too small (need {} bytes, but got {})",
6487 Self::ENCODED_LEN,
6488 __tmp.remaining(),
6489 )
6490 }
6491 __tmp.put_i32_le(self.current_consumed);
6492 __tmp.put_i32_le(self.energy_consumed);
6493 __tmp.put_i16_le(self.temperature);
6494 for val in &self.voltages {
6495 __tmp.put_u16_le(*val);
6496 }
6497 __tmp.put_i16_le(self.current_battery);
6498 __tmp.put_u8(self.id);
6499 __tmp.put_u8(self.battery_function as u8);
6500 __tmp.put_u8(self.mavtype as u8);
6501 __tmp.put_i8(self.battery_remaining);
6502 __tmp.put_i32_le(self.time_remaining);
6503 __tmp.put_u8(self.charge_state as u8);
6504 for val in &self.voltages_ext {
6505 __tmp.put_u16_le(*val);
6506 }
6507 __tmp.put_u8(self.mode as u8);
6508 __tmp.put_u32_le(self.fault_bitmask.bits());
6509 if matches!(version, MavlinkVersion::V2) {
6510 let len = __tmp.len();
6511 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6512 } else {
6513 __tmp.len()
6514 }
6515 }
6516}
6517#[doc = "id: 257"]
6518#[doc = "Report button state change."]
6519#[derive(Debug, Clone, PartialEq)]
6520#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6521#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6522pub struct BUTTON_CHANGE_DATA {
6523 #[doc = "Timestamp (time since system boot)."]
6524 pub time_boot_ms: u32,
6525 #[doc = "Time of last change of button state."]
6526 pub last_change_ms: u32,
6527 #[doc = "Bitmap for state of buttons."]
6528 pub state: u8,
6529}
6530impl BUTTON_CHANGE_DATA {
6531 pub const ENCODED_LEN: usize = 9usize;
6532 pub const DEFAULT: Self = Self {
6533 time_boot_ms: 0_u32,
6534 last_change_ms: 0_u32,
6535 state: 0_u8,
6536 };
6537 #[cfg(feature = "arbitrary")]
6538 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6539 use arbitrary::{Arbitrary, Unstructured};
6540 let mut buf = [0u8; 1024];
6541 rng.fill_bytes(&mut buf);
6542 let mut unstructured = Unstructured::new(&buf);
6543 Self::arbitrary(&mut unstructured).unwrap_or_default()
6544 }
6545}
6546impl Default for BUTTON_CHANGE_DATA {
6547 fn default() -> Self {
6548 Self::DEFAULT.clone()
6549 }
6550}
6551impl MessageData for BUTTON_CHANGE_DATA {
6552 type Message = MavMessage;
6553 const ID: u32 = 257u32;
6554 const NAME: &'static str = "BUTTON_CHANGE";
6555 const EXTRA_CRC: u8 = 131u8;
6556 const ENCODED_LEN: usize = 9usize;
6557 fn deser(
6558 _version: MavlinkVersion,
6559 __input: &[u8],
6560 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6561 let avail_len = __input.len();
6562 let mut payload_buf = [0; Self::ENCODED_LEN];
6563 let mut buf = if avail_len < Self::ENCODED_LEN {
6564 payload_buf[0..avail_len].copy_from_slice(__input);
6565 Bytes::new(&payload_buf)
6566 } else {
6567 Bytes::new(__input)
6568 };
6569 let mut __struct = Self::default();
6570 __struct.time_boot_ms = buf.get_u32_le();
6571 __struct.last_change_ms = buf.get_u32_le();
6572 __struct.state = buf.get_u8();
6573 Ok(__struct)
6574 }
6575 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6576 let mut __tmp = BytesMut::new(bytes);
6577 #[allow(clippy::absurd_extreme_comparisons)]
6578 #[allow(unused_comparisons)]
6579 if __tmp.remaining() < Self::ENCODED_LEN {
6580 panic!(
6581 "buffer is too small (need {} bytes, but got {})",
6582 Self::ENCODED_LEN,
6583 __tmp.remaining(),
6584 )
6585 }
6586 __tmp.put_u32_le(self.time_boot_ms);
6587 __tmp.put_u32_le(self.last_change_ms);
6588 __tmp.put_u8(self.state);
6589 if matches!(version, MavlinkVersion::V2) {
6590 let len = __tmp.len();
6591 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6592 } else {
6593 __tmp.len()
6594 }
6595 }
6596}
6597#[doc = "id: 262"]
6598#[doc = "Information about the status of a capture. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
6599#[derive(Debug, Clone, PartialEq)]
6600#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6601#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6602pub struct CAMERA_CAPTURE_STATUS_DATA {
6603 #[doc = "Timestamp (time since system boot)."]
6604 pub time_boot_ms: u32,
6605 #[doc = "Image capture interval"]
6606 pub image_interval: f32,
6607 #[doc = "Elapsed time since recording started (0: Not supported/available). A GCS should compute recording time and use non-zero values of this field to correct any discrepancy."]
6608 pub recording_time_ms: u32,
6609 #[doc = "Available storage capacity."]
6610 pub available_capacity: f32,
6611 #[doc = "Current status of image capturing (0: idle, 1: capture in progress, 2: interval set but idle, 3: interval set and capture in progress)"]
6612 pub image_status: u8,
6613 #[doc = "Current status of video capturing (0: idle, 1: capture in progress)"]
6614 pub video_status: u8,
6615 #[doc = "Total number of images captured ('forever', or until reset using MAV_CMD_STORAGE_FORMAT)."]
6616 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6617 pub image_count: i32,
6618 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
6619 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6620 pub camera_device_id: u8,
6621}
6622impl CAMERA_CAPTURE_STATUS_DATA {
6623 pub const ENCODED_LEN: usize = 23usize;
6624 pub const DEFAULT: Self = Self {
6625 time_boot_ms: 0_u32,
6626 image_interval: 0.0_f32,
6627 recording_time_ms: 0_u32,
6628 available_capacity: 0.0_f32,
6629 image_status: 0_u8,
6630 video_status: 0_u8,
6631 image_count: 0_i32,
6632 camera_device_id: 0_u8,
6633 };
6634 #[cfg(feature = "arbitrary")]
6635 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6636 use arbitrary::{Arbitrary, Unstructured};
6637 let mut buf = [0u8; 1024];
6638 rng.fill_bytes(&mut buf);
6639 let mut unstructured = Unstructured::new(&buf);
6640 Self::arbitrary(&mut unstructured).unwrap_or_default()
6641 }
6642}
6643impl Default for CAMERA_CAPTURE_STATUS_DATA {
6644 fn default() -> Self {
6645 Self::DEFAULT.clone()
6646 }
6647}
6648impl MessageData for CAMERA_CAPTURE_STATUS_DATA {
6649 type Message = MavMessage;
6650 const ID: u32 = 262u32;
6651 const NAME: &'static str = "CAMERA_CAPTURE_STATUS";
6652 const EXTRA_CRC: u8 = 12u8;
6653 const ENCODED_LEN: usize = 23usize;
6654 fn deser(
6655 _version: MavlinkVersion,
6656 __input: &[u8],
6657 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6658 let avail_len = __input.len();
6659 let mut payload_buf = [0; Self::ENCODED_LEN];
6660 let mut buf = if avail_len < Self::ENCODED_LEN {
6661 payload_buf[0..avail_len].copy_from_slice(__input);
6662 Bytes::new(&payload_buf)
6663 } else {
6664 Bytes::new(__input)
6665 };
6666 let mut __struct = Self::default();
6667 __struct.time_boot_ms = buf.get_u32_le();
6668 __struct.image_interval = buf.get_f32_le();
6669 __struct.recording_time_ms = buf.get_u32_le();
6670 __struct.available_capacity = buf.get_f32_le();
6671 __struct.image_status = buf.get_u8();
6672 __struct.video_status = buf.get_u8();
6673 __struct.image_count = buf.get_i32_le();
6674 __struct.camera_device_id = buf.get_u8();
6675 Ok(__struct)
6676 }
6677 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6678 let mut __tmp = BytesMut::new(bytes);
6679 #[allow(clippy::absurd_extreme_comparisons)]
6680 #[allow(unused_comparisons)]
6681 if __tmp.remaining() < Self::ENCODED_LEN {
6682 panic!(
6683 "buffer is too small (need {} bytes, but got {})",
6684 Self::ENCODED_LEN,
6685 __tmp.remaining(),
6686 )
6687 }
6688 __tmp.put_u32_le(self.time_boot_ms);
6689 __tmp.put_f32_le(self.image_interval);
6690 __tmp.put_u32_le(self.recording_time_ms);
6691 __tmp.put_f32_le(self.available_capacity);
6692 __tmp.put_u8(self.image_status);
6693 __tmp.put_u8(self.video_status);
6694 __tmp.put_i32_le(self.image_count);
6695 __tmp.put_u8(self.camera_device_id);
6696 if matches!(version, MavlinkVersion::V2) {
6697 let len = __tmp.len();
6698 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6699 } else {
6700 __tmp.len()
6701 }
6702 }
6703}
6704#[doc = "id: 271"]
6705#[doc = "Information about the field of view of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
6706#[derive(Debug, Clone, PartialEq)]
6707#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6708#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6709pub struct CAMERA_FOV_STATUS_DATA {
6710 #[doc = "Timestamp (time since system boot)."]
6711 pub time_boot_ms: u32,
6712 #[doc = "Latitude of camera (INT32_MAX if unknown)."]
6713 pub lat_camera: i32,
6714 #[doc = "Longitude of camera (INT32_MAX if unknown)."]
6715 pub lon_camera: i32,
6716 #[doc = "Altitude (MSL) of camera (INT32_MAX if unknown)."]
6717 pub alt_camera: i32,
6718 #[doc = "Latitude of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon)."]
6719 pub lat_image: i32,
6720 #[doc = "Longitude of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon)."]
6721 pub lon_image: i32,
6722 #[doc = "Altitude (MSL) of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon)."]
6723 pub alt_image: i32,
6724 #[doc = "Quaternion of camera orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
6725 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6726 pub q: [f32; 4],
6727 #[doc = "Horizontal field of view (NaN if unknown)."]
6728 pub hfov: f32,
6729 #[doc = "Vertical field of view (NaN if unknown)."]
6730 pub vfov: f32,
6731 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
6732 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6733 pub camera_device_id: u8,
6734}
6735impl CAMERA_FOV_STATUS_DATA {
6736 pub const ENCODED_LEN: usize = 53usize;
6737 pub const DEFAULT: Self = Self {
6738 time_boot_ms: 0_u32,
6739 lat_camera: 0_i32,
6740 lon_camera: 0_i32,
6741 alt_camera: 0_i32,
6742 lat_image: 0_i32,
6743 lon_image: 0_i32,
6744 alt_image: 0_i32,
6745 q: [0.0_f32; 4usize],
6746 hfov: 0.0_f32,
6747 vfov: 0.0_f32,
6748 camera_device_id: 0_u8,
6749 };
6750 #[cfg(feature = "arbitrary")]
6751 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6752 use arbitrary::{Arbitrary, Unstructured};
6753 let mut buf = [0u8; 1024];
6754 rng.fill_bytes(&mut buf);
6755 let mut unstructured = Unstructured::new(&buf);
6756 Self::arbitrary(&mut unstructured).unwrap_or_default()
6757 }
6758}
6759impl Default for CAMERA_FOV_STATUS_DATA {
6760 fn default() -> Self {
6761 Self::DEFAULT.clone()
6762 }
6763}
6764impl MessageData for CAMERA_FOV_STATUS_DATA {
6765 type Message = MavMessage;
6766 const ID: u32 = 271u32;
6767 const NAME: &'static str = "CAMERA_FOV_STATUS";
6768 const EXTRA_CRC: u8 = 22u8;
6769 const ENCODED_LEN: usize = 53usize;
6770 fn deser(
6771 _version: MavlinkVersion,
6772 __input: &[u8],
6773 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6774 let avail_len = __input.len();
6775 let mut payload_buf = [0; Self::ENCODED_LEN];
6776 let mut buf = if avail_len < Self::ENCODED_LEN {
6777 payload_buf[0..avail_len].copy_from_slice(__input);
6778 Bytes::new(&payload_buf)
6779 } else {
6780 Bytes::new(__input)
6781 };
6782 let mut __struct = Self::default();
6783 __struct.time_boot_ms = buf.get_u32_le();
6784 __struct.lat_camera = buf.get_i32_le();
6785 __struct.lon_camera = buf.get_i32_le();
6786 __struct.alt_camera = buf.get_i32_le();
6787 __struct.lat_image = buf.get_i32_le();
6788 __struct.lon_image = buf.get_i32_le();
6789 __struct.alt_image = buf.get_i32_le();
6790 for v in &mut __struct.q {
6791 let val = buf.get_f32_le();
6792 *v = val;
6793 }
6794 __struct.hfov = buf.get_f32_le();
6795 __struct.vfov = buf.get_f32_le();
6796 __struct.camera_device_id = buf.get_u8();
6797 Ok(__struct)
6798 }
6799 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6800 let mut __tmp = BytesMut::new(bytes);
6801 #[allow(clippy::absurd_extreme_comparisons)]
6802 #[allow(unused_comparisons)]
6803 if __tmp.remaining() < Self::ENCODED_LEN {
6804 panic!(
6805 "buffer is too small (need {} bytes, but got {})",
6806 Self::ENCODED_LEN,
6807 __tmp.remaining(),
6808 )
6809 }
6810 __tmp.put_u32_le(self.time_boot_ms);
6811 __tmp.put_i32_le(self.lat_camera);
6812 __tmp.put_i32_le(self.lon_camera);
6813 __tmp.put_i32_le(self.alt_camera);
6814 __tmp.put_i32_le(self.lat_image);
6815 __tmp.put_i32_le(self.lon_image);
6816 __tmp.put_i32_le(self.alt_image);
6817 for val in &self.q {
6818 __tmp.put_f32_le(*val);
6819 }
6820 __tmp.put_f32_le(self.hfov);
6821 __tmp.put_f32_le(self.vfov);
6822 __tmp.put_u8(self.camera_device_id);
6823 if matches!(version, MavlinkVersion::V2) {
6824 let len = __tmp.len();
6825 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6826 } else {
6827 __tmp.len()
6828 }
6829 }
6830}
6831#[doc = "id: 263"]
6832#[doc = "Information about a captured image. This is emitted every time a message is captured. MAV_CMD_REQUEST_MESSAGE can be used to (re)request this message for a specific sequence number or range of sequence numbers: MAV_CMD_REQUEST_MESSAGE.param2 indicates the sequence number the first image to send, or set to -1 to send the message for all sequence numbers. MAV_CMD_REQUEST_MESSAGE.param3 is used to specify a range of messages to send: set to 0 (default) to send just the the message for the sequence number in param 2, set to -1 to send the message for the sequence number in param 2 and all the following sequence numbers, set to the sequence number of the final message in the range."]
6833#[derive(Debug, Clone, PartialEq)]
6834#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6835#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6836pub struct CAMERA_IMAGE_CAPTURED_DATA {
6837 #[doc = "Timestamp (time since UNIX epoch) in UTC. 0 for unknown."]
6838 pub time_utc: u64,
6839 #[doc = "Timestamp (time since system boot)."]
6840 pub time_boot_ms: u32,
6841 #[doc = "Latitude where image was taken"]
6842 pub lat: i32,
6843 #[doc = "Longitude where capture was taken"]
6844 pub lon: i32,
6845 #[doc = "Altitude (MSL) where image was taken"]
6846 pub alt: i32,
6847 #[doc = "Altitude above ground"]
6848 pub relative_alt: i32,
6849 #[doc = "Quaternion of camera orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
6850 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6851 pub q: [f32; 4],
6852 #[doc = "Zero based index of this image (i.e. a new image will have index CAMERA_CAPTURE_STATUS.image count -1)"]
6853 pub image_index: i32,
6854 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id). Field name is usually camera_device_id."]
6855 pub camera_id: u8,
6856 #[doc = "Boolean indicating success (1) or failure (0) while capturing this image."]
6857 pub capture_result: i8,
6858 #[doc = "URL of image taken. Either local storage or <http://foo.jpg> if camera provides an HTTP interface."]
6859 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6860 pub file_url: [u8; 205],
6861}
6862impl CAMERA_IMAGE_CAPTURED_DATA {
6863 pub const ENCODED_LEN: usize = 255usize;
6864 pub const DEFAULT: Self = Self {
6865 time_utc: 0_u64,
6866 time_boot_ms: 0_u32,
6867 lat: 0_i32,
6868 lon: 0_i32,
6869 alt: 0_i32,
6870 relative_alt: 0_i32,
6871 q: [0.0_f32; 4usize],
6872 image_index: 0_i32,
6873 camera_id: 0_u8,
6874 capture_result: 0_i8,
6875 file_url: [0_u8; 205usize],
6876 };
6877 #[cfg(feature = "arbitrary")]
6878 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6879 use arbitrary::{Arbitrary, Unstructured};
6880 let mut buf = [0u8; 1024];
6881 rng.fill_bytes(&mut buf);
6882 let mut unstructured = Unstructured::new(&buf);
6883 Self::arbitrary(&mut unstructured).unwrap_or_default()
6884 }
6885}
6886impl Default for CAMERA_IMAGE_CAPTURED_DATA {
6887 fn default() -> Self {
6888 Self::DEFAULT.clone()
6889 }
6890}
6891impl MessageData for CAMERA_IMAGE_CAPTURED_DATA {
6892 type Message = MavMessage;
6893 const ID: u32 = 263u32;
6894 const NAME: &'static str = "CAMERA_IMAGE_CAPTURED";
6895 const EXTRA_CRC: u8 = 133u8;
6896 const ENCODED_LEN: usize = 255usize;
6897 fn deser(
6898 _version: MavlinkVersion,
6899 __input: &[u8],
6900 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6901 let avail_len = __input.len();
6902 let mut payload_buf = [0; Self::ENCODED_LEN];
6903 let mut buf = if avail_len < Self::ENCODED_LEN {
6904 payload_buf[0..avail_len].copy_from_slice(__input);
6905 Bytes::new(&payload_buf)
6906 } else {
6907 Bytes::new(__input)
6908 };
6909 let mut __struct = Self::default();
6910 __struct.time_utc = buf.get_u64_le();
6911 __struct.time_boot_ms = buf.get_u32_le();
6912 __struct.lat = buf.get_i32_le();
6913 __struct.lon = buf.get_i32_le();
6914 __struct.alt = buf.get_i32_le();
6915 __struct.relative_alt = buf.get_i32_le();
6916 for v in &mut __struct.q {
6917 let val = buf.get_f32_le();
6918 *v = val;
6919 }
6920 __struct.image_index = buf.get_i32_le();
6921 __struct.camera_id = buf.get_u8();
6922 __struct.capture_result = buf.get_i8();
6923 for v in &mut __struct.file_url {
6924 let val = buf.get_u8();
6925 *v = val;
6926 }
6927 Ok(__struct)
6928 }
6929 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6930 let mut __tmp = BytesMut::new(bytes);
6931 #[allow(clippy::absurd_extreme_comparisons)]
6932 #[allow(unused_comparisons)]
6933 if __tmp.remaining() < Self::ENCODED_LEN {
6934 panic!(
6935 "buffer is too small (need {} bytes, but got {})",
6936 Self::ENCODED_LEN,
6937 __tmp.remaining(),
6938 )
6939 }
6940 __tmp.put_u64_le(self.time_utc);
6941 __tmp.put_u32_le(self.time_boot_ms);
6942 __tmp.put_i32_le(self.lat);
6943 __tmp.put_i32_le(self.lon);
6944 __tmp.put_i32_le(self.alt);
6945 __tmp.put_i32_le(self.relative_alt);
6946 for val in &self.q {
6947 __tmp.put_f32_le(*val);
6948 }
6949 __tmp.put_i32_le(self.image_index);
6950 __tmp.put_u8(self.camera_id);
6951 __tmp.put_i8(self.capture_result);
6952 for val in &self.file_url {
6953 __tmp.put_u8(*val);
6954 }
6955 if matches!(version, MavlinkVersion::V2) {
6956 let len = __tmp.len();
6957 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6958 } else {
6959 __tmp.len()
6960 }
6961 }
6962}
6963#[doc = "id: 259"]
6964#[doc = "Information about a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
6965#[derive(Debug, Clone, PartialEq)]
6966#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6967#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6968pub struct CAMERA_INFORMATION_DATA {
6969 #[doc = "Timestamp (time since system boot)."]
6970 pub time_boot_ms: u32,
6971 #[doc = "0xff). Use 0 if not known."]
6972 pub firmware_version: u32,
6973 #[doc = "Focal length. Use NaN if not known."]
6974 pub focal_length: f32,
6975 #[doc = "Image sensor size horizontal. Use NaN if not known."]
6976 pub sensor_size_h: f32,
6977 #[doc = "Image sensor size vertical. Use NaN if not known."]
6978 pub sensor_size_v: f32,
6979 #[doc = "Bitmap of camera capability flags."]
6980 pub flags: CameraCapFlags,
6981 #[doc = "Horizontal image resolution. Use 0 if not known."]
6982 pub resolution_h: u16,
6983 #[doc = "Vertical image resolution. Use 0 if not known."]
6984 pub resolution_v: u16,
6985 #[doc = "Camera definition version (iteration). Use 0 if not known."]
6986 pub cam_definition_version: u16,
6987 #[doc = "Name of the camera vendor"]
6988 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6989 pub vendor_name: [u8; 32],
6990 #[doc = "Name of the camera model"]
6991 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6992 pub model_name: [u8; 32],
6993 #[doc = "Reserved for a lens ID. Use 0 if not known."]
6994 pub lens_id: u8,
6995 #[doc = "Camera definition URI (if any, otherwise only basic functions will be available). HTTP- (http://) and MAVLink FTP- (mavlinkftp://) formatted URIs are allowed (and both must be supported by any GCS that implements the Camera Protocol). The definition file may be xz compressed, which will be indicated by the file extension .xml.xz (a GCS that implements the protocol must support decompressing the file). The string needs to be zero terminated. Use a zero-length string if not known."]
6996 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6997 pub cam_definition_uri: [u8; 140],
6998 #[doc = "Gimbal id of a gimbal associated with this camera. This is the component id of the gimbal device, or 1-6 for non mavlink gimbals. Use 0 if no gimbal is associated with the camera."]
6999 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7000 pub gimbal_device_id: u8,
7001 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7002 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7003 pub camera_device_id: u8,
7004}
7005impl CAMERA_INFORMATION_DATA {
7006 pub const ENCODED_LEN: usize = 237usize;
7007 pub const DEFAULT: Self = Self {
7008 time_boot_ms: 0_u32,
7009 firmware_version: 0_u32,
7010 focal_length: 0.0_f32,
7011 sensor_size_h: 0.0_f32,
7012 sensor_size_v: 0.0_f32,
7013 flags: CameraCapFlags::DEFAULT,
7014 resolution_h: 0_u16,
7015 resolution_v: 0_u16,
7016 cam_definition_version: 0_u16,
7017 vendor_name: [0_u8; 32usize],
7018 model_name: [0_u8; 32usize],
7019 lens_id: 0_u8,
7020 cam_definition_uri: [0_u8; 140usize],
7021 gimbal_device_id: 0_u8,
7022 camera_device_id: 0_u8,
7023 };
7024 #[cfg(feature = "arbitrary")]
7025 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7026 use arbitrary::{Arbitrary, Unstructured};
7027 let mut buf = [0u8; 1024];
7028 rng.fill_bytes(&mut buf);
7029 let mut unstructured = Unstructured::new(&buf);
7030 Self::arbitrary(&mut unstructured).unwrap_or_default()
7031 }
7032}
7033impl Default for CAMERA_INFORMATION_DATA {
7034 fn default() -> Self {
7035 Self::DEFAULT.clone()
7036 }
7037}
7038impl MessageData for CAMERA_INFORMATION_DATA {
7039 type Message = MavMessage;
7040 const ID: u32 = 259u32;
7041 const NAME: &'static str = "CAMERA_INFORMATION";
7042 const EXTRA_CRC: u8 = 92u8;
7043 const ENCODED_LEN: usize = 237usize;
7044 fn deser(
7045 _version: MavlinkVersion,
7046 __input: &[u8],
7047 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7048 let avail_len = __input.len();
7049 let mut payload_buf = [0; Self::ENCODED_LEN];
7050 let mut buf = if avail_len < Self::ENCODED_LEN {
7051 payload_buf[0..avail_len].copy_from_slice(__input);
7052 Bytes::new(&payload_buf)
7053 } else {
7054 Bytes::new(__input)
7055 };
7056 let mut __struct = Self::default();
7057 __struct.time_boot_ms = buf.get_u32_le();
7058 __struct.firmware_version = buf.get_u32_le();
7059 __struct.focal_length = buf.get_f32_le();
7060 __struct.sensor_size_h = buf.get_f32_le();
7061 __struct.sensor_size_v = buf.get_f32_le();
7062 let tmp = buf.get_u32_le();
7063 __struct.flags = CameraCapFlags::from_bits(tmp & CameraCapFlags::all().bits()).ok_or(
7064 ::mavlink_core::error::ParserError::InvalidFlag {
7065 flag_type: "CameraCapFlags",
7066 value: tmp as u32,
7067 },
7068 )?;
7069 __struct.resolution_h = buf.get_u16_le();
7070 __struct.resolution_v = buf.get_u16_le();
7071 __struct.cam_definition_version = buf.get_u16_le();
7072 for v in &mut __struct.vendor_name {
7073 let val = buf.get_u8();
7074 *v = val;
7075 }
7076 for v in &mut __struct.model_name {
7077 let val = buf.get_u8();
7078 *v = val;
7079 }
7080 __struct.lens_id = buf.get_u8();
7081 for v in &mut __struct.cam_definition_uri {
7082 let val = buf.get_u8();
7083 *v = val;
7084 }
7085 __struct.gimbal_device_id = buf.get_u8();
7086 __struct.camera_device_id = buf.get_u8();
7087 Ok(__struct)
7088 }
7089 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7090 let mut __tmp = BytesMut::new(bytes);
7091 #[allow(clippy::absurd_extreme_comparisons)]
7092 #[allow(unused_comparisons)]
7093 if __tmp.remaining() < Self::ENCODED_LEN {
7094 panic!(
7095 "buffer is too small (need {} bytes, but got {})",
7096 Self::ENCODED_LEN,
7097 __tmp.remaining(),
7098 )
7099 }
7100 __tmp.put_u32_le(self.time_boot_ms);
7101 __tmp.put_u32_le(self.firmware_version);
7102 __tmp.put_f32_le(self.focal_length);
7103 __tmp.put_f32_le(self.sensor_size_h);
7104 __tmp.put_f32_le(self.sensor_size_v);
7105 __tmp.put_u32_le(self.flags.bits());
7106 __tmp.put_u16_le(self.resolution_h);
7107 __tmp.put_u16_le(self.resolution_v);
7108 __tmp.put_u16_le(self.cam_definition_version);
7109 for val in &self.vendor_name {
7110 __tmp.put_u8(*val);
7111 }
7112 for val in &self.model_name {
7113 __tmp.put_u8(*val);
7114 }
7115 __tmp.put_u8(self.lens_id);
7116 for val in &self.cam_definition_uri {
7117 __tmp.put_u8(*val);
7118 }
7119 __tmp.put_u8(self.gimbal_device_id);
7120 __tmp.put_u8(self.camera_device_id);
7121 if matches!(version, MavlinkVersion::V2) {
7122 let len = __tmp.len();
7123 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7124 } else {
7125 __tmp.len()
7126 }
7127 }
7128}
7129#[doc = "id: 260"]
7130#[doc = "Settings of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
7131#[derive(Debug, Clone, PartialEq)]
7132#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7133#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7134pub struct CAMERA_SETTINGS_DATA {
7135 #[doc = "Timestamp (time since system boot)."]
7136 pub time_boot_ms: u32,
7137 #[doc = "Camera mode"]
7138 pub mode_id: CameraMode,
7139 #[doc = "Current zoom level as a percentage of the full range (0.0 to 100.0, NaN if not known)"]
7140 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7141 pub zoomLevel: f32,
7142 #[doc = "Current focus level as a percentage of the full range (0.0 to 100.0, NaN if not known)"]
7143 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7144 pub focusLevel: f32,
7145 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7146 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7147 pub camera_device_id: u8,
7148}
7149impl CAMERA_SETTINGS_DATA {
7150 pub const ENCODED_LEN: usize = 14usize;
7151 pub const DEFAULT: Self = Self {
7152 time_boot_ms: 0_u32,
7153 mode_id: CameraMode::DEFAULT,
7154 zoomLevel: 0.0_f32,
7155 focusLevel: 0.0_f32,
7156 camera_device_id: 0_u8,
7157 };
7158 #[cfg(feature = "arbitrary")]
7159 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7160 use arbitrary::{Arbitrary, Unstructured};
7161 let mut buf = [0u8; 1024];
7162 rng.fill_bytes(&mut buf);
7163 let mut unstructured = Unstructured::new(&buf);
7164 Self::arbitrary(&mut unstructured).unwrap_or_default()
7165 }
7166}
7167impl Default for CAMERA_SETTINGS_DATA {
7168 fn default() -> Self {
7169 Self::DEFAULT.clone()
7170 }
7171}
7172impl MessageData for CAMERA_SETTINGS_DATA {
7173 type Message = MavMessage;
7174 const ID: u32 = 260u32;
7175 const NAME: &'static str = "CAMERA_SETTINGS";
7176 const EXTRA_CRC: u8 = 146u8;
7177 const ENCODED_LEN: usize = 14usize;
7178 fn deser(
7179 _version: MavlinkVersion,
7180 __input: &[u8],
7181 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7182 let avail_len = __input.len();
7183 let mut payload_buf = [0; Self::ENCODED_LEN];
7184 let mut buf = if avail_len < Self::ENCODED_LEN {
7185 payload_buf[0..avail_len].copy_from_slice(__input);
7186 Bytes::new(&payload_buf)
7187 } else {
7188 Bytes::new(__input)
7189 };
7190 let mut __struct = Self::default();
7191 __struct.time_boot_ms = buf.get_u32_le();
7192 let tmp = buf.get_u8();
7193 __struct.mode_id =
7194 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7195 enum_type: "CameraMode",
7196 value: tmp as u32,
7197 })?;
7198 __struct.zoomLevel = buf.get_f32_le();
7199 __struct.focusLevel = buf.get_f32_le();
7200 __struct.camera_device_id = buf.get_u8();
7201 Ok(__struct)
7202 }
7203 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7204 let mut __tmp = BytesMut::new(bytes);
7205 #[allow(clippy::absurd_extreme_comparisons)]
7206 #[allow(unused_comparisons)]
7207 if __tmp.remaining() < Self::ENCODED_LEN {
7208 panic!(
7209 "buffer is too small (need {} bytes, but got {})",
7210 Self::ENCODED_LEN,
7211 __tmp.remaining(),
7212 )
7213 }
7214 __tmp.put_u32_le(self.time_boot_ms);
7215 __tmp.put_u8(self.mode_id as u8);
7216 __tmp.put_f32_le(self.zoomLevel);
7217 __tmp.put_f32_le(self.focusLevel);
7218 __tmp.put_u8(self.camera_device_id);
7219 if matches!(version, MavlinkVersion::V2) {
7220 let len = __tmp.len();
7221 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7222 } else {
7223 __tmp.len()
7224 }
7225 }
7226}
7227#[doc = "id: 277"]
7228#[doc = "Camera absolute thermal range. This can be streamed when the associated VIDEO_STREAM_STATUS `flag` field bit VIDEO_STREAM_STATUS_FLAGS_THERMAL_RANGE_ENABLED is set, but a GCS may choose to only request it for the current active stream. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval (param3 indicates the stream id of the current camera, or 0 for all streams, param4 indicates the target camera_device_id for autopilot-attached cameras or 0 for MAVLink cameras)."]
7229#[derive(Debug, Clone, PartialEq)]
7230#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7231#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7232pub struct CAMERA_THERMAL_RANGE_DATA {
7233 #[doc = "Timestamp (time since system boot)."]
7234 pub time_boot_ms: u32,
7235 #[doc = "Temperature max."]
7236 pub max: f32,
7237 #[doc = "Temperature max point x value (normalized 0..1, 0 is left, 1 is right), NAN if unknown."]
7238 pub max_point_x: f32,
7239 #[doc = "Temperature max point y value (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown."]
7240 pub max_point_y: f32,
7241 #[doc = "Temperature min."]
7242 pub min: f32,
7243 #[doc = "Temperature min point x value (normalized 0..1, 0 is left, 1 is right), NAN if unknown."]
7244 pub min_point_x: f32,
7245 #[doc = "Temperature min point y value (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown."]
7246 pub min_point_y: f32,
7247 #[doc = "Video Stream ID (1 for first, 2 for second, etc.)"]
7248 pub stream_id: u8,
7249 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7250 pub camera_device_id: u8,
7251}
7252impl CAMERA_THERMAL_RANGE_DATA {
7253 pub const ENCODED_LEN: usize = 30usize;
7254 pub const DEFAULT: Self = Self {
7255 time_boot_ms: 0_u32,
7256 max: 0.0_f32,
7257 max_point_x: 0.0_f32,
7258 max_point_y: 0.0_f32,
7259 min: 0.0_f32,
7260 min_point_x: 0.0_f32,
7261 min_point_y: 0.0_f32,
7262 stream_id: 0_u8,
7263 camera_device_id: 0_u8,
7264 };
7265 #[cfg(feature = "arbitrary")]
7266 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7267 use arbitrary::{Arbitrary, Unstructured};
7268 let mut buf = [0u8; 1024];
7269 rng.fill_bytes(&mut buf);
7270 let mut unstructured = Unstructured::new(&buf);
7271 Self::arbitrary(&mut unstructured).unwrap_or_default()
7272 }
7273}
7274impl Default for CAMERA_THERMAL_RANGE_DATA {
7275 fn default() -> Self {
7276 Self::DEFAULT.clone()
7277 }
7278}
7279impl MessageData for CAMERA_THERMAL_RANGE_DATA {
7280 type Message = MavMessage;
7281 const ID: u32 = 277u32;
7282 const NAME: &'static str = "CAMERA_THERMAL_RANGE";
7283 const EXTRA_CRC: u8 = 62u8;
7284 const ENCODED_LEN: usize = 30usize;
7285 fn deser(
7286 _version: MavlinkVersion,
7287 __input: &[u8],
7288 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7289 let avail_len = __input.len();
7290 let mut payload_buf = [0; Self::ENCODED_LEN];
7291 let mut buf = if avail_len < Self::ENCODED_LEN {
7292 payload_buf[0..avail_len].copy_from_slice(__input);
7293 Bytes::new(&payload_buf)
7294 } else {
7295 Bytes::new(__input)
7296 };
7297 let mut __struct = Self::default();
7298 __struct.time_boot_ms = buf.get_u32_le();
7299 __struct.max = buf.get_f32_le();
7300 __struct.max_point_x = buf.get_f32_le();
7301 __struct.max_point_y = buf.get_f32_le();
7302 __struct.min = buf.get_f32_le();
7303 __struct.min_point_x = buf.get_f32_le();
7304 __struct.min_point_y = buf.get_f32_le();
7305 __struct.stream_id = buf.get_u8();
7306 __struct.camera_device_id = buf.get_u8();
7307 Ok(__struct)
7308 }
7309 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7310 let mut __tmp = BytesMut::new(bytes);
7311 #[allow(clippy::absurd_extreme_comparisons)]
7312 #[allow(unused_comparisons)]
7313 if __tmp.remaining() < Self::ENCODED_LEN {
7314 panic!(
7315 "buffer is too small (need {} bytes, but got {})",
7316 Self::ENCODED_LEN,
7317 __tmp.remaining(),
7318 )
7319 }
7320 __tmp.put_u32_le(self.time_boot_ms);
7321 __tmp.put_f32_le(self.max);
7322 __tmp.put_f32_le(self.max_point_x);
7323 __tmp.put_f32_le(self.max_point_y);
7324 __tmp.put_f32_le(self.min);
7325 __tmp.put_f32_le(self.min_point_x);
7326 __tmp.put_f32_le(self.min_point_y);
7327 __tmp.put_u8(self.stream_id);
7328 __tmp.put_u8(self.camera_device_id);
7329 if matches!(version, MavlinkVersion::V2) {
7330 let len = __tmp.len();
7331 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7332 } else {
7333 __tmp.len()
7334 }
7335 }
7336}
7337#[doc = "id: 276"]
7338#[doc = "Camera tracking status, sent while in active tracking. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval."]
7339#[derive(Debug, Clone, PartialEq)]
7340#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7341#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7342pub struct CAMERA_TRACKING_GEO_STATUS_DATA {
7343 #[doc = "Latitude of tracked object"]
7344 pub lat: i32,
7345 #[doc = "Longitude of tracked object"]
7346 pub lon: i32,
7347 #[doc = "Altitude of tracked object(AMSL, WGS84)"]
7348 pub alt: f32,
7349 #[doc = "Horizontal accuracy. NAN if unknown"]
7350 pub h_acc: f32,
7351 #[doc = "Vertical accuracy. NAN if unknown"]
7352 pub v_acc: f32,
7353 #[doc = "North velocity of tracked object. NAN if unknown"]
7354 pub vel_n: f32,
7355 #[doc = "East velocity of tracked object. NAN if unknown"]
7356 pub vel_e: f32,
7357 #[doc = "Down velocity of tracked object. NAN if unknown"]
7358 pub vel_d: f32,
7359 #[doc = "Velocity accuracy. NAN if unknown"]
7360 pub vel_acc: f32,
7361 #[doc = "Distance between camera and tracked object. NAN if unknown"]
7362 pub dist: f32,
7363 #[doc = "Heading in radians, in NED. NAN if unknown"]
7364 pub hdg: f32,
7365 #[doc = "Accuracy of heading, in NED. NAN if unknown"]
7366 pub hdg_acc: f32,
7367 #[doc = "Current tracking status"]
7368 pub tracking_status: CameraTrackingStatusFlags,
7369 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7370 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7371 pub camera_device_id: u8,
7372}
7373impl CAMERA_TRACKING_GEO_STATUS_DATA {
7374 pub const ENCODED_LEN: usize = 50usize;
7375 pub const DEFAULT: Self = Self {
7376 lat: 0_i32,
7377 lon: 0_i32,
7378 alt: 0.0_f32,
7379 h_acc: 0.0_f32,
7380 v_acc: 0.0_f32,
7381 vel_n: 0.0_f32,
7382 vel_e: 0.0_f32,
7383 vel_d: 0.0_f32,
7384 vel_acc: 0.0_f32,
7385 dist: 0.0_f32,
7386 hdg: 0.0_f32,
7387 hdg_acc: 0.0_f32,
7388 tracking_status: CameraTrackingStatusFlags::DEFAULT,
7389 camera_device_id: 0_u8,
7390 };
7391 #[cfg(feature = "arbitrary")]
7392 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7393 use arbitrary::{Arbitrary, Unstructured};
7394 let mut buf = [0u8; 1024];
7395 rng.fill_bytes(&mut buf);
7396 let mut unstructured = Unstructured::new(&buf);
7397 Self::arbitrary(&mut unstructured).unwrap_or_default()
7398 }
7399}
7400impl Default for CAMERA_TRACKING_GEO_STATUS_DATA {
7401 fn default() -> Self {
7402 Self::DEFAULT.clone()
7403 }
7404}
7405impl MessageData for CAMERA_TRACKING_GEO_STATUS_DATA {
7406 type Message = MavMessage;
7407 const ID: u32 = 276u32;
7408 const NAME: &'static str = "CAMERA_TRACKING_GEO_STATUS";
7409 const EXTRA_CRC: u8 = 18u8;
7410 const ENCODED_LEN: usize = 50usize;
7411 fn deser(
7412 _version: MavlinkVersion,
7413 __input: &[u8],
7414 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7415 let avail_len = __input.len();
7416 let mut payload_buf = [0; Self::ENCODED_LEN];
7417 let mut buf = if avail_len < Self::ENCODED_LEN {
7418 payload_buf[0..avail_len].copy_from_slice(__input);
7419 Bytes::new(&payload_buf)
7420 } else {
7421 Bytes::new(__input)
7422 };
7423 let mut __struct = Self::default();
7424 __struct.lat = buf.get_i32_le();
7425 __struct.lon = buf.get_i32_le();
7426 __struct.alt = buf.get_f32_le();
7427 __struct.h_acc = buf.get_f32_le();
7428 __struct.v_acc = buf.get_f32_le();
7429 __struct.vel_n = buf.get_f32_le();
7430 __struct.vel_e = buf.get_f32_le();
7431 __struct.vel_d = buf.get_f32_le();
7432 __struct.vel_acc = buf.get_f32_le();
7433 __struct.dist = buf.get_f32_le();
7434 __struct.hdg = buf.get_f32_le();
7435 __struct.hdg_acc = buf.get_f32_le();
7436 let tmp = buf.get_u8();
7437 __struct.tracking_status =
7438 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7439 enum_type: "CameraTrackingStatusFlags",
7440 value: tmp as u32,
7441 })?;
7442 __struct.camera_device_id = buf.get_u8();
7443 Ok(__struct)
7444 }
7445 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7446 let mut __tmp = BytesMut::new(bytes);
7447 #[allow(clippy::absurd_extreme_comparisons)]
7448 #[allow(unused_comparisons)]
7449 if __tmp.remaining() < Self::ENCODED_LEN {
7450 panic!(
7451 "buffer is too small (need {} bytes, but got {})",
7452 Self::ENCODED_LEN,
7453 __tmp.remaining(),
7454 )
7455 }
7456 __tmp.put_i32_le(self.lat);
7457 __tmp.put_i32_le(self.lon);
7458 __tmp.put_f32_le(self.alt);
7459 __tmp.put_f32_le(self.h_acc);
7460 __tmp.put_f32_le(self.v_acc);
7461 __tmp.put_f32_le(self.vel_n);
7462 __tmp.put_f32_le(self.vel_e);
7463 __tmp.put_f32_le(self.vel_d);
7464 __tmp.put_f32_le(self.vel_acc);
7465 __tmp.put_f32_le(self.dist);
7466 __tmp.put_f32_le(self.hdg);
7467 __tmp.put_f32_le(self.hdg_acc);
7468 __tmp.put_u8(self.tracking_status as u8);
7469 __tmp.put_u8(self.camera_device_id);
7470 if matches!(version, MavlinkVersion::V2) {
7471 let len = __tmp.len();
7472 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7473 } else {
7474 __tmp.len()
7475 }
7476 }
7477}
7478#[doc = "id: 275"]
7479#[doc = "Camera tracking status, sent while in active tracking. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval."]
7480#[derive(Debug, Clone, PartialEq)]
7481#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7482#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7483pub struct CAMERA_TRACKING_IMAGE_STATUS_DATA {
7484 #[doc = "Current tracked point x value if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is left, 1 is right), NAN if unknown"]
7485 pub point_x: f32,
7486 #[doc = "Current tracked point y value if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown"]
7487 pub point_y: f32,
7488 #[doc = "Current tracked radius if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is image left, 1 is image right), NAN if unknown"]
7489 pub radius: f32,
7490 #[doc = "Current tracked rectangle top x value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is left, 1 is right), NAN if unknown"]
7491 pub rec_top_x: f32,
7492 #[doc = "Current tracked rectangle top y value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown"]
7493 pub rec_top_y: f32,
7494 #[doc = "Current tracked rectangle bottom x value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is left, 1 is right), NAN if unknown"]
7495 pub rec_bottom_x: f32,
7496 #[doc = "Current tracked rectangle bottom y value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown"]
7497 pub rec_bottom_y: f32,
7498 #[doc = "Current tracking status"]
7499 pub tracking_status: CameraTrackingStatusFlags,
7500 #[doc = "Current tracking mode"]
7501 pub tracking_mode: CameraTrackingMode,
7502 #[doc = "Defines location of target data"]
7503 pub target_data: CameraTrackingTargetData,
7504 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7505 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7506 pub camera_device_id: u8,
7507}
7508impl CAMERA_TRACKING_IMAGE_STATUS_DATA {
7509 pub const ENCODED_LEN: usize = 32usize;
7510 pub const DEFAULT: Self = Self {
7511 point_x: 0.0_f32,
7512 point_y: 0.0_f32,
7513 radius: 0.0_f32,
7514 rec_top_x: 0.0_f32,
7515 rec_top_y: 0.0_f32,
7516 rec_bottom_x: 0.0_f32,
7517 rec_bottom_y: 0.0_f32,
7518 tracking_status: CameraTrackingStatusFlags::DEFAULT,
7519 tracking_mode: CameraTrackingMode::DEFAULT,
7520 target_data: CameraTrackingTargetData::DEFAULT,
7521 camera_device_id: 0_u8,
7522 };
7523 #[cfg(feature = "arbitrary")]
7524 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7525 use arbitrary::{Arbitrary, Unstructured};
7526 let mut buf = [0u8; 1024];
7527 rng.fill_bytes(&mut buf);
7528 let mut unstructured = Unstructured::new(&buf);
7529 Self::arbitrary(&mut unstructured).unwrap_or_default()
7530 }
7531}
7532impl Default for CAMERA_TRACKING_IMAGE_STATUS_DATA {
7533 fn default() -> Self {
7534 Self::DEFAULT.clone()
7535 }
7536}
7537impl MessageData for CAMERA_TRACKING_IMAGE_STATUS_DATA {
7538 type Message = MavMessage;
7539 const ID: u32 = 275u32;
7540 const NAME: &'static str = "CAMERA_TRACKING_IMAGE_STATUS";
7541 const EXTRA_CRC: u8 = 126u8;
7542 const ENCODED_LEN: usize = 32usize;
7543 fn deser(
7544 _version: MavlinkVersion,
7545 __input: &[u8],
7546 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7547 let avail_len = __input.len();
7548 let mut payload_buf = [0; Self::ENCODED_LEN];
7549 let mut buf = if avail_len < Self::ENCODED_LEN {
7550 payload_buf[0..avail_len].copy_from_slice(__input);
7551 Bytes::new(&payload_buf)
7552 } else {
7553 Bytes::new(__input)
7554 };
7555 let mut __struct = Self::default();
7556 __struct.point_x = buf.get_f32_le();
7557 __struct.point_y = buf.get_f32_le();
7558 __struct.radius = buf.get_f32_le();
7559 __struct.rec_top_x = buf.get_f32_le();
7560 __struct.rec_top_y = buf.get_f32_le();
7561 __struct.rec_bottom_x = buf.get_f32_le();
7562 __struct.rec_bottom_y = buf.get_f32_le();
7563 let tmp = buf.get_u8();
7564 __struct.tracking_status =
7565 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7566 enum_type: "CameraTrackingStatusFlags",
7567 value: tmp as u32,
7568 })?;
7569 let tmp = buf.get_u8();
7570 __struct.tracking_mode =
7571 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7572 enum_type: "CameraTrackingMode",
7573 value: tmp as u32,
7574 })?;
7575 let tmp = buf.get_u8();
7576 __struct.target_data =
7577 CameraTrackingTargetData::from_bits(tmp & CameraTrackingTargetData::all().bits())
7578 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
7579 flag_type: "CameraTrackingTargetData",
7580 value: tmp as u32,
7581 })?;
7582 __struct.camera_device_id = buf.get_u8();
7583 Ok(__struct)
7584 }
7585 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7586 let mut __tmp = BytesMut::new(bytes);
7587 #[allow(clippy::absurd_extreme_comparisons)]
7588 #[allow(unused_comparisons)]
7589 if __tmp.remaining() < Self::ENCODED_LEN {
7590 panic!(
7591 "buffer is too small (need {} bytes, but got {})",
7592 Self::ENCODED_LEN,
7593 __tmp.remaining(),
7594 )
7595 }
7596 __tmp.put_f32_le(self.point_x);
7597 __tmp.put_f32_le(self.point_y);
7598 __tmp.put_f32_le(self.radius);
7599 __tmp.put_f32_le(self.rec_top_x);
7600 __tmp.put_f32_le(self.rec_top_y);
7601 __tmp.put_f32_le(self.rec_bottom_x);
7602 __tmp.put_f32_le(self.rec_bottom_y);
7603 __tmp.put_u8(self.tracking_status as u8);
7604 __tmp.put_u8(self.tracking_mode as u8);
7605 __tmp.put_u8(self.target_data.bits());
7606 __tmp.put_u8(self.camera_device_id);
7607 if matches!(version, MavlinkVersion::V2) {
7608 let len = __tmp.len();
7609 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7610 } else {
7611 __tmp.len()
7612 }
7613 }
7614}
7615#[doc = "id: 112"]
7616#[doc = "Camera-IMU triggering and synchronisation message."]
7617#[derive(Debug, Clone, PartialEq)]
7618#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7619#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7620pub struct CAMERA_TRIGGER_DATA {
7621 #[doc = "Timestamp for image frame (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
7622 pub time_usec: u64,
7623 #[doc = "Image frame sequence"]
7624 pub seq: u32,
7625}
7626impl CAMERA_TRIGGER_DATA {
7627 pub const ENCODED_LEN: usize = 12usize;
7628 pub const DEFAULT: Self = Self {
7629 time_usec: 0_u64,
7630 seq: 0_u32,
7631 };
7632 #[cfg(feature = "arbitrary")]
7633 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7634 use arbitrary::{Arbitrary, Unstructured};
7635 let mut buf = [0u8; 1024];
7636 rng.fill_bytes(&mut buf);
7637 let mut unstructured = Unstructured::new(&buf);
7638 Self::arbitrary(&mut unstructured).unwrap_or_default()
7639 }
7640}
7641impl Default for CAMERA_TRIGGER_DATA {
7642 fn default() -> Self {
7643 Self::DEFAULT.clone()
7644 }
7645}
7646impl MessageData for CAMERA_TRIGGER_DATA {
7647 type Message = MavMessage;
7648 const ID: u32 = 112u32;
7649 const NAME: &'static str = "CAMERA_TRIGGER";
7650 const EXTRA_CRC: u8 = 174u8;
7651 const ENCODED_LEN: usize = 12usize;
7652 fn deser(
7653 _version: MavlinkVersion,
7654 __input: &[u8],
7655 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7656 let avail_len = __input.len();
7657 let mut payload_buf = [0; Self::ENCODED_LEN];
7658 let mut buf = if avail_len < Self::ENCODED_LEN {
7659 payload_buf[0..avail_len].copy_from_slice(__input);
7660 Bytes::new(&payload_buf)
7661 } else {
7662 Bytes::new(__input)
7663 };
7664 let mut __struct = Self::default();
7665 __struct.time_usec = buf.get_u64_le();
7666 __struct.seq = buf.get_u32_le();
7667 Ok(__struct)
7668 }
7669 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7670 let mut __tmp = BytesMut::new(bytes);
7671 #[allow(clippy::absurd_extreme_comparisons)]
7672 #[allow(unused_comparisons)]
7673 if __tmp.remaining() < Self::ENCODED_LEN {
7674 panic!(
7675 "buffer is too small (need {} bytes, but got {})",
7676 Self::ENCODED_LEN,
7677 __tmp.remaining(),
7678 )
7679 }
7680 __tmp.put_u64_le(self.time_usec);
7681 __tmp.put_u32_le(self.seq);
7682 if matches!(version, MavlinkVersion::V2) {
7683 let len = __tmp.len();
7684 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7685 } else {
7686 __tmp.len()
7687 }
7688 }
7689}
7690#[doc = "id: 387"]
7691#[doc = "A forwarded CANFD frame as requested by MAV_CMD_CAN_FORWARD. These are separated from CAN_FRAME as they need different handling (eg. TAO handling)."]
7692#[derive(Debug, Clone, PartialEq)]
7693#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7694#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7695pub struct CANFD_FRAME_DATA {
7696 #[doc = "Frame ID"]
7697 pub id: u32,
7698 #[doc = "System ID."]
7699 pub target_system: u8,
7700 #[doc = "Component ID."]
7701 pub target_component: u8,
7702 #[doc = "bus number"]
7703 pub bus: u8,
7704 #[doc = "Frame length"]
7705 pub len: u8,
7706 #[doc = "Frame data"]
7707 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7708 pub data: [u8; 64],
7709}
7710impl CANFD_FRAME_DATA {
7711 pub const ENCODED_LEN: usize = 72usize;
7712 pub const DEFAULT: Self = Self {
7713 id: 0_u32,
7714 target_system: 0_u8,
7715 target_component: 0_u8,
7716 bus: 0_u8,
7717 len: 0_u8,
7718 data: [0_u8; 64usize],
7719 };
7720 #[cfg(feature = "arbitrary")]
7721 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7722 use arbitrary::{Arbitrary, Unstructured};
7723 let mut buf = [0u8; 1024];
7724 rng.fill_bytes(&mut buf);
7725 let mut unstructured = Unstructured::new(&buf);
7726 Self::arbitrary(&mut unstructured).unwrap_or_default()
7727 }
7728}
7729impl Default for CANFD_FRAME_DATA {
7730 fn default() -> Self {
7731 Self::DEFAULT.clone()
7732 }
7733}
7734impl MessageData for CANFD_FRAME_DATA {
7735 type Message = MavMessage;
7736 const ID: u32 = 387u32;
7737 const NAME: &'static str = "CANFD_FRAME";
7738 const EXTRA_CRC: u8 = 4u8;
7739 const ENCODED_LEN: usize = 72usize;
7740 fn deser(
7741 _version: MavlinkVersion,
7742 __input: &[u8],
7743 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7744 let avail_len = __input.len();
7745 let mut payload_buf = [0; Self::ENCODED_LEN];
7746 let mut buf = if avail_len < Self::ENCODED_LEN {
7747 payload_buf[0..avail_len].copy_from_slice(__input);
7748 Bytes::new(&payload_buf)
7749 } else {
7750 Bytes::new(__input)
7751 };
7752 let mut __struct = Self::default();
7753 __struct.id = buf.get_u32_le();
7754 __struct.target_system = buf.get_u8();
7755 __struct.target_component = buf.get_u8();
7756 __struct.bus = buf.get_u8();
7757 __struct.len = buf.get_u8();
7758 for v in &mut __struct.data {
7759 let val = buf.get_u8();
7760 *v = val;
7761 }
7762 Ok(__struct)
7763 }
7764 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7765 let mut __tmp = BytesMut::new(bytes);
7766 #[allow(clippy::absurd_extreme_comparisons)]
7767 #[allow(unused_comparisons)]
7768 if __tmp.remaining() < Self::ENCODED_LEN {
7769 panic!(
7770 "buffer is too small (need {} bytes, but got {})",
7771 Self::ENCODED_LEN,
7772 __tmp.remaining(),
7773 )
7774 }
7775 __tmp.put_u32_le(self.id);
7776 __tmp.put_u8(self.target_system);
7777 __tmp.put_u8(self.target_component);
7778 __tmp.put_u8(self.bus);
7779 __tmp.put_u8(self.len);
7780 for val in &self.data {
7781 __tmp.put_u8(*val);
7782 }
7783 if matches!(version, MavlinkVersion::V2) {
7784 let len = __tmp.len();
7785 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7786 } else {
7787 __tmp.len()
7788 }
7789 }
7790}
7791#[doc = "id: 388"]
7792#[doc = "Modify the filter of what CAN messages to forward over the mavlink. This can be used to make CAN forwarding work well on low bandwidth links. The filtering is applied on bits 8 to 24 of the CAN id (2nd and 3rd bytes) which corresponds to the DroneCAN message ID for DroneCAN. Filters with more than 16 IDs can be constructed by sending multiple CAN_FILTER_MODIFY messages."]
7793#[derive(Debug, Clone, PartialEq)]
7794#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7795#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7796pub struct CAN_FILTER_MODIFY_DATA {
7797 #[doc = "filter IDs, length num_ids"]
7798 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7799 pub ids: [u16; 16],
7800 #[doc = "System ID."]
7801 pub target_system: u8,
7802 #[doc = "Component ID."]
7803 pub target_component: u8,
7804 #[doc = "bus number"]
7805 pub bus: u8,
7806 #[doc = "what operation to perform on the filter list. See CAN_FILTER_OP enum."]
7807 pub operation: CanFilterOp,
7808 #[doc = "number of IDs in filter list"]
7809 pub num_ids: u8,
7810}
7811impl CAN_FILTER_MODIFY_DATA {
7812 pub const ENCODED_LEN: usize = 37usize;
7813 pub const DEFAULT: Self = Self {
7814 ids: [0_u16; 16usize],
7815 target_system: 0_u8,
7816 target_component: 0_u8,
7817 bus: 0_u8,
7818 operation: CanFilterOp::DEFAULT,
7819 num_ids: 0_u8,
7820 };
7821 #[cfg(feature = "arbitrary")]
7822 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7823 use arbitrary::{Arbitrary, Unstructured};
7824 let mut buf = [0u8; 1024];
7825 rng.fill_bytes(&mut buf);
7826 let mut unstructured = Unstructured::new(&buf);
7827 Self::arbitrary(&mut unstructured).unwrap_or_default()
7828 }
7829}
7830impl Default for CAN_FILTER_MODIFY_DATA {
7831 fn default() -> Self {
7832 Self::DEFAULT.clone()
7833 }
7834}
7835impl MessageData for CAN_FILTER_MODIFY_DATA {
7836 type Message = MavMessage;
7837 const ID: u32 = 388u32;
7838 const NAME: &'static str = "CAN_FILTER_MODIFY";
7839 const EXTRA_CRC: u8 = 8u8;
7840 const ENCODED_LEN: usize = 37usize;
7841 fn deser(
7842 _version: MavlinkVersion,
7843 __input: &[u8],
7844 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7845 let avail_len = __input.len();
7846 let mut payload_buf = [0; Self::ENCODED_LEN];
7847 let mut buf = if avail_len < Self::ENCODED_LEN {
7848 payload_buf[0..avail_len].copy_from_slice(__input);
7849 Bytes::new(&payload_buf)
7850 } else {
7851 Bytes::new(__input)
7852 };
7853 let mut __struct = Self::default();
7854 for v in &mut __struct.ids {
7855 let val = buf.get_u16_le();
7856 *v = val;
7857 }
7858 __struct.target_system = buf.get_u8();
7859 __struct.target_component = buf.get_u8();
7860 __struct.bus = buf.get_u8();
7861 let tmp = buf.get_u8();
7862 __struct.operation =
7863 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7864 enum_type: "CanFilterOp",
7865 value: tmp as u32,
7866 })?;
7867 __struct.num_ids = buf.get_u8();
7868 Ok(__struct)
7869 }
7870 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7871 let mut __tmp = BytesMut::new(bytes);
7872 #[allow(clippy::absurd_extreme_comparisons)]
7873 #[allow(unused_comparisons)]
7874 if __tmp.remaining() < Self::ENCODED_LEN {
7875 panic!(
7876 "buffer is too small (need {} bytes, but got {})",
7877 Self::ENCODED_LEN,
7878 __tmp.remaining(),
7879 )
7880 }
7881 for val in &self.ids {
7882 __tmp.put_u16_le(*val);
7883 }
7884 __tmp.put_u8(self.target_system);
7885 __tmp.put_u8(self.target_component);
7886 __tmp.put_u8(self.bus);
7887 __tmp.put_u8(self.operation as u8);
7888 __tmp.put_u8(self.num_ids);
7889 if matches!(version, MavlinkVersion::V2) {
7890 let len = __tmp.len();
7891 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7892 } else {
7893 __tmp.len()
7894 }
7895 }
7896}
7897#[doc = "id: 386"]
7898#[doc = "A forwarded CAN frame as requested by MAV_CMD_CAN_FORWARD."]
7899#[derive(Debug, Clone, PartialEq)]
7900#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7901#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7902pub struct CAN_FRAME_DATA {
7903 #[doc = "Frame ID"]
7904 pub id: u32,
7905 #[doc = "System ID."]
7906 pub target_system: u8,
7907 #[doc = "Component ID."]
7908 pub target_component: u8,
7909 #[doc = "Bus number"]
7910 pub bus: u8,
7911 #[doc = "Frame length"]
7912 pub len: u8,
7913 #[doc = "Frame data"]
7914 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7915 pub data: [u8; 8],
7916}
7917impl CAN_FRAME_DATA {
7918 pub const ENCODED_LEN: usize = 16usize;
7919 pub const DEFAULT: Self = Self {
7920 id: 0_u32,
7921 target_system: 0_u8,
7922 target_component: 0_u8,
7923 bus: 0_u8,
7924 len: 0_u8,
7925 data: [0_u8; 8usize],
7926 };
7927 #[cfg(feature = "arbitrary")]
7928 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7929 use arbitrary::{Arbitrary, Unstructured};
7930 let mut buf = [0u8; 1024];
7931 rng.fill_bytes(&mut buf);
7932 let mut unstructured = Unstructured::new(&buf);
7933 Self::arbitrary(&mut unstructured).unwrap_or_default()
7934 }
7935}
7936impl Default for CAN_FRAME_DATA {
7937 fn default() -> Self {
7938 Self::DEFAULT.clone()
7939 }
7940}
7941impl MessageData for CAN_FRAME_DATA {
7942 type Message = MavMessage;
7943 const ID: u32 = 386u32;
7944 const NAME: &'static str = "CAN_FRAME";
7945 const EXTRA_CRC: u8 = 132u8;
7946 const ENCODED_LEN: usize = 16usize;
7947 fn deser(
7948 _version: MavlinkVersion,
7949 __input: &[u8],
7950 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7951 let avail_len = __input.len();
7952 let mut payload_buf = [0; Self::ENCODED_LEN];
7953 let mut buf = if avail_len < Self::ENCODED_LEN {
7954 payload_buf[0..avail_len].copy_from_slice(__input);
7955 Bytes::new(&payload_buf)
7956 } else {
7957 Bytes::new(__input)
7958 };
7959 let mut __struct = Self::default();
7960 __struct.id = buf.get_u32_le();
7961 __struct.target_system = buf.get_u8();
7962 __struct.target_component = buf.get_u8();
7963 __struct.bus = buf.get_u8();
7964 __struct.len = buf.get_u8();
7965 for v in &mut __struct.data {
7966 let val = buf.get_u8();
7967 *v = val;
7968 }
7969 Ok(__struct)
7970 }
7971 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7972 let mut __tmp = BytesMut::new(bytes);
7973 #[allow(clippy::absurd_extreme_comparisons)]
7974 #[allow(unused_comparisons)]
7975 if __tmp.remaining() < Self::ENCODED_LEN {
7976 panic!(
7977 "buffer is too small (need {} bytes, but got {})",
7978 Self::ENCODED_LEN,
7979 __tmp.remaining(),
7980 )
7981 }
7982 __tmp.put_u32_le(self.id);
7983 __tmp.put_u8(self.target_system);
7984 __tmp.put_u8(self.target_component);
7985 __tmp.put_u8(self.bus);
7986 __tmp.put_u8(self.len);
7987 for val in &self.data {
7988 __tmp.put_u8(*val);
7989 }
7990 if matches!(version, MavlinkVersion::V2) {
7991 let len = __tmp.len();
7992 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7993 } else {
7994 __tmp.len()
7995 }
7996 }
7997}
7998#[doc = "id: 336"]
7999#[doc = "Configure cellular modems. This message is re-emitted as an acknowledgement by the modem. The message may also be explicitly requested using MAV_CMD_REQUEST_MESSAGE."]
8000#[derive(Debug, Clone, PartialEq)]
8001#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8002#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8003pub struct CELLULAR_CONFIG_DATA {
8004 #[doc = "Enable/disable LTE. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response."]
8005 pub enable_lte: u8,
8006 #[doc = "Enable/disable PIN on the SIM card. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response."]
8007 pub enable_pin: u8,
8008 #[doc = "PIN sent to the SIM card. Blank when PIN is disabled. Empty when message is sent back as a response."]
8009 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8010 pub pin: [u8; 16],
8011 #[doc = "New PIN when changing the PIN. Blank to leave it unchanged. Empty when message is sent back as a response."]
8012 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8013 pub new_pin: [u8; 16],
8014 #[doc = "Name of the cellular APN. Blank to leave it unchanged. Current APN when sent back as a response."]
8015 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8016 pub apn: [u8; 32],
8017 #[doc = "Required PUK code in case the user failed to authenticate 3 times with the PIN. Empty when message is sent back as a response."]
8018 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8019 pub puk: [u8; 16],
8020 #[doc = "Enable/disable roaming. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response."]
8021 pub roaming: u8,
8022 #[doc = "Message acceptance response (sent back to GS)."]
8023 pub response: CellularConfigResponse,
8024}
8025impl CELLULAR_CONFIG_DATA {
8026 pub const ENCODED_LEN: usize = 84usize;
8027 pub const DEFAULT: Self = Self {
8028 enable_lte: 0_u8,
8029 enable_pin: 0_u8,
8030 pin: [0_u8; 16usize],
8031 new_pin: [0_u8; 16usize],
8032 apn: [0_u8; 32usize],
8033 puk: [0_u8; 16usize],
8034 roaming: 0_u8,
8035 response: CellularConfigResponse::DEFAULT,
8036 };
8037 #[cfg(feature = "arbitrary")]
8038 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8039 use arbitrary::{Arbitrary, Unstructured};
8040 let mut buf = [0u8; 1024];
8041 rng.fill_bytes(&mut buf);
8042 let mut unstructured = Unstructured::new(&buf);
8043 Self::arbitrary(&mut unstructured).unwrap_or_default()
8044 }
8045}
8046impl Default for CELLULAR_CONFIG_DATA {
8047 fn default() -> Self {
8048 Self::DEFAULT.clone()
8049 }
8050}
8051impl MessageData for CELLULAR_CONFIG_DATA {
8052 type Message = MavMessage;
8053 const ID: u32 = 336u32;
8054 const NAME: &'static str = "CELLULAR_CONFIG";
8055 const EXTRA_CRC: u8 = 245u8;
8056 const ENCODED_LEN: usize = 84usize;
8057 fn deser(
8058 _version: MavlinkVersion,
8059 __input: &[u8],
8060 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8061 let avail_len = __input.len();
8062 let mut payload_buf = [0; Self::ENCODED_LEN];
8063 let mut buf = if avail_len < Self::ENCODED_LEN {
8064 payload_buf[0..avail_len].copy_from_slice(__input);
8065 Bytes::new(&payload_buf)
8066 } else {
8067 Bytes::new(__input)
8068 };
8069 let mut __struct = Self::default();
8070 __struct.enable_lte = buf.get_u8();
8071 __struct.enable_pin = buf.get_u8();
8072 for v in &mut __struct.pin {
8073 let val = buf.get_u8();
8074 *v = val;
8075 }
8076 for v in &mut __struct.new_pin {
8077 let val = buf.get_u8();
8078 *v = val;
8079 }
8080 for v in &mut __struct.apn {
8081 let val = buf.get_u8();
8082 *v = val;
8083 }
8084 for v in &mut __struct.puk {
8085 let val = buf.get_u8();
8086 *v = val;
8087 }
8088 __struct.roaming = buf.get_u8();
8089 let tmp = buf.get_u8();
8090 __struct.response =
8091 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8092 enum_type: "CellularConfigResponse",
8093 value: tmp as u32,
8094 })?;
8095 Ok(__struct)
8096 }
8097 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8098 let mut __tmp = BytesMut::new(bytes);
8099 #[allow(clippy::absurd_extreme_comparisons)]
8100 #[allow(unused_comparisons)]
8101 if __tmp.remaining() < Self::ENCODED_LEN {
8102 panic!(
8103 "buffer is too small (need {} bytes, but got {})",
8104 Self::ENCODED_LEN,
8105 __tmp.remaining(),
8106 )
8107 }
8108 __tmp.put_u8(self.enable_lte);
8109 __tmp.put_u8(self.enable_pin);
8110 for val in &self.pin {
8111 __tmp.put_u8(*val);
8112 }
8113 for val in &self.new_pin {
8114 __tmp.put_u8(*val);
8115 }
8116 for val in &self.apn {
8117 __tmp.put_u8(*val);
8118 }
8119 for val in &self.puk {
8120 __tmp.put_u8(*val);
8121 }
8122 __tmp.put_u8(self.roaming);
8123 __tmp.put_u8(self.response as u8);
8124 if matches!(version, MavlinkVersion::V2) {
8125 let len = __tmp.len();
8126 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8127 } else {
8128 __tmp.len()
8129 }
8130 }
8131}
8132#[doc = "id: 334"]
8133#[doc = "Report current used cellular network status."]
8134#[derive(Debug, Clone, PartialEq)]
8135#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8136#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8137pub struct CELLULAR_STATUS_DATA {
8138 #[doc = "Mobile country code. If unknown, set to UINT16_MAX"]
8139 pub mcc: u16,
8140 #[doc = "Mobile network code. If unknown, set to UINT16_MAX"]
8141 pub mnc: u16,
8142 #[doc = "Location area code. If unknown, set to 0"]
8143 pub lac: u16,
8144 #[doc = "Cellular modem status"]
8145 pub status: CellularStatusFlag,
8146 #[doc = "Failure reason when status in in CELLULAR_STATUS_FLAG_FAILED"]
8147 pub failure_reason: CellularNetworkFailedReason,
8148 #[doc = "Cellular network radio type: gsm, cdma, lte..."]
8149 pub mavtype: CellularNetworkRadioType,
8150 #[doc = "Signal quality in percent. If unknown, set to UINT8_MAX"]
8151 pub quality: u8,
8152}
8153impl CELLULAR_STATUS_DATA {
8154 pub const ENCODED_LEN: usize = 10usize;
8155 pub const DEFAULT: Self = Self {
8156 mcc: 0_u16,
8157 mnc: 0_u16,
8158 lac: 0_u16,
8159 status: CellularStatusFlag::DEFAULT,
8160 failure_reason: CellularNetworkFailedReason::DEFAULT,
8161 mavtype: CellularNetworkRadioType::DEFAULT,
8162 quality: 0_u8,
8163 };
8164 #[cfg(feature = "arbitrary")]
8165 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8166 use arbitrary::{Arbitrary, Unstructured};
8167 let mut buf = [0u8; 1024];
8168 rng.fill_bytes(&mut buf);
8169 let mut unstructured = Unstructured::new(&buf);
8170 Self::arbitrary(&mut unstructured).unwrap_or_default()
8171 }
8172}
8173impl Default for CELLULAR_STATUS_DATA {
8174 fn default() -> Self {
8175 Self::DEFAULT.clone()
8176 }
8177}
8178impl MessageData for CELLULAR_STATUS_DATA {
8179 type Message = MavMessage;
8180 const ID: u32 = 334u32;
8181 const NAME: &'static str = "CELLULAR_STATUS";
8182 const EXTRA_CRC: u8 = 72u8;
8183 const ENCODED_LEN: usize = 10usize;
8184 fn deser(
8185 _version: MavlinkVersion,
8186 __input: &[u8],
8187 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8188 let avail_len = __input.len();
8189 let mut payload_buf = [0; Self::ENCODED_LEN];
8190 let mut buf = if avail_len < Self::ENCODED_LEN {
8191 payload_buf[0..avail_len].copy_from_slice(__input);
8192 Bytes::new(&payload_buf)
8193 } else {
8194 Bytes::new(__input)
8195 };
8196 let mut __struct = Self::default();
8197 __struct.mcc = buf.get_u16_le();
8198 __struct.mnc = buf.get_u16_le();
8199 __struct.lac = buf.get_u16_le();
8200 let tmp = buf.get_u8();
8201 __struct.status =
8202 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8203 enum_type: "CellularStatusFlag",
8204 value: tmp as u32,
8205 })?;
8206 let tmp = buf.get_u8();
8207 __struct.failure_reason =
8208 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8209 enum_type: "CellularNetworkFailedReason",
8210 value: tmp as u32,
8211 })?;
8212 let tmp = buf.get_u8();
8213 __struct.mavtype =
8214 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8215 enum_type: "CellularNetworkRadioType",
8216 value: tmp as u32,
8217 })?;
8218 __struct.quality = buf.get_u8();
8219 Ok(__struct)
8220 }
8221 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8222 let mut __tmp = BytesMut::new(bytes);
8223 #[allow(clippy::absurd_extreme_comparisons)]
8224 #[allow(unused_comparisons)]
8225 if __tmp.remaining() < Self::ENCODED_LEN {
8226 panic!(
8227 "buffer is too small (need {} bytes, but got {})",
8228 Self::ENCODED_LEN,
8229 __tmp.remaining(),
8230 )
8231 }
8232 __tmp.put_u16_le(self.mcc);
8233 __tmp.put_u16_le(self.mnc);
8234 __tmp.put_u16_le(self.lac);
8235 __tmp.put_u8(self.status as u8);
8236 __tmp.put_u8(self.failure_reason as u8);
8237 __tmp.put_u8(self.mavtype as u8);
8238 __tmp.put_u8(self.quality);
8239 if matches!(version, MavlinkVersion::V2) {
8240 let len = __tmp.len();
8241 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8242 } else {
8243 __tmp.len()
8244 }
8245 }
8246}
8247#[doc = "id: 5"]
8248#[doc = "Request to control this MAV."]
8249#[derive(Debug, Clone, PartialEq)]
8250#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8251#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8252pub struct CHANGE_OPERATOR_CONTROL_DATA {
8253 #[doc = "System the GCS requests control for"]
8254 pub target_system: u8,
8255 #[doc = "0: request control of this MAV, 1: Release control of this MAV"]
8256 pub control_request: u8,
8257 #[doc = "0: key as plaintext, 1-255: future, different hashing/encryption variants. The GCS should in general use the safest mode possible initially and then gradually move down the encryption level if it gets a NACK message indicating an encryption mismatch."]
8258 pub version: u8,
8259 #[doc = "Password / Key, depending on version plaintext or encrypted. 25 or less characters, NULL terminated. The characters may involve A-Z, a-z, 0-9, and \"!?,.-\""]
8260 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8261 pub passkey: [u8; 25],
8262}
8263impl CHANGE_OPERATOR_CONTROL_DATA {
8264 pub const ENCODED_LEN: usize = 28usize;
8265 pub const DEFAULT: Self = Self {
8266 target_system: 0_u8,
8267 control_request: 0_u8,
8268 version: 0_u8,
8269 passkey: [0_u8; 25usize],
8270 };
8271 #[cfg(feature = "arbitrary")]
8272 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8273 use arbitrary::{Arbitrary, Unstructured};
8274 let mut buf = [0u8; 1024];
8275 rng.fill_bytes(&mut buf);
8276 let mut unstructured = Unstructured::new(&buf);
8277 Self::arbitrary(&mut unstructured).unwrap_or_default()
8278 }
8279}
8280impl Default for CHANGE_OPERATOR_CONTROL_DATA {
8281 fn default() -> Self {
8282 Self::DEFAULT.clone()
8283 }
8284}
8285impl MessageData for CHANGE_OPERATOR_CONTROL_DATA {
8286 type Message = MavMessage;
8287 const ID: u32 = 5u32;
8288 const NAME: &'static str = "CHANGE_OPERATOR_CONTROL";
8289 const EXTRA_CRC: u8 = 217u8;
8290 const ENCODED_LEN: usize = 28usize;
8291 fn deser(
8292 _version: MavlinkVersion,
8293 __input: &[u8],
8294 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8295 let avail_len = __input.len();
8296 let mut payload_buf = [0; Self::ENCODED_LEN];
8297 let mut buf = if avail_len < Self::ENCODED_LEN {
8298 payload_buf[0..avail_len].copy_from_slice(__input);
8299 Bytes::new(&payload_buf)
8300 } else {
8301 Bytes::new(__input)
8302 };
8303 let mut __struct = Self::default();
8304 __struct.target_system = buf.get_u8();
8305 __struct.control_request = buf.get_u8();
8306 __struct.version = buf.get_u8();
8307 for v in &mut __struct.passkey {
8308 let val = buf.get_u8();
8309 *v = val;
8310 }
8311 Ok(__struct)
8312 }
8313 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8314 let mut __tmp = BytesMut::new(bytes);
8315 #[allow(clippy::absurd_extreme_comparisons)]
8316 #[allow(unused_comparisons)]
8317 if __tmp.remaining() < Self::ENCODED_LEN {
8318 panic!(
8319 "buffer is too small (need {} bytes, but got {})",
8320 Self::ENCODED_LEN,
8321 __tmp.remaining(),
8322 )
8323 }
8324 __tmp.put_u8(self.target_system);
8325 __tmp.put_u8(self.control_request);
8326 __tmp.put_u8(self.version);
8327 for val in &self.passkey {
8328 __tmp.put_u8(*val);
8329 }
8330 if matches!(version, MavlinkVersion::V2) {
8331 let len = __tmp.len();
8332 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8333 } else {
8334 __tmp.len()
8335 }
8336 }
8337}
8338#[doc = "id: 6"]
8339#[doc = "Accept / deny control of this MAV."]
8340#[derive(Debug, Clone, PartialEq)]
8341#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8342#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8343pub struct CHANGE_OPERATOR_CONTROL_ACK_DATA {
8344 #[doc = "ID of the GCS this message"]
8345 pub gcs_system_id: u8,
8346 #[doc = "0: request control of this MAV, 1: Release control of this MAV"]
8347 pub control_request: u8,
8348 #[doc = "0: ACK, 1: NACK: Wrong passkey, 2: NACK: Unsupported passkey encryption method, 3: NACK: Already under control"]
8349 pub ack: u8,
8350}
8351impl CHANGE_OPERATOR_CONTROL_ACK_DATA {
8352 pub const ENCODED_LEN: usize = 3usize;
8353 pub const DEFAULT: Self = Self {
8354 gcs_system_id: 0_u8,
8355 control_request: 0_u8,
8356 ack: 0_u8,
8357 };
8358 #[cfg(feature = "arbitrary")]
8359 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8360 use arbitrary::{Arbitrary, Unstructured};
8361 let mut buf = [0u8; 1024];
8362 rng.fill_bytes(&mut buf);
8363 let mut unstructured = Unstructured::new(&buf);
8364 Self::arbitrary(&mut unstructured).unwrap_or_default()
8365 }
8366}
8367impl Default for CHANGE_OPERATOR_CONTROL_ACK_DATA {
8368 fn default() -> Self {
8369 Self::DEFAULT.clone()
8370 }
8371}
8372impl MessageData for CHANGE_OPERATOR_CONTROL_ACK_DATA {
8373 type Message = MavMessage;
8374 const ID: u32 = 6u32;
8375 const NAME: &'static str = "CHANGE_OPERATOR_CONTROL_ACK";
8376 const EXTRA_CRC: u8 = 104u8;
8377 const ENCODED_LEN: usize = 3usize;
8378 fn deser(
8379 _version: MavlinkVersion,
8380 __input: &[u8],
8381 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8382 let avail_len = __input.len();
8383 let mut payload_buf = [0; Self::ENCODED_LEN];
8384 let mut buf = if avail_len < Self::ENCODED_LEN {
8385 payload_buf[0..avail_len].copy_from_slice(__input);
8386 Bytes::new(&payload_buf)
8387 } else {
8388 Bytes::new(__input)
8389 };
8390 let mut __struct = Self::default();
8391 __struct.gcs_system_id = buf.get_u8();
8392 __struct.control_request = buf.get_u8();
8393 __struct.ack = buf.get_u8();
8394 Ok(__struct)
8395 }
8396 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8397 let mut __tmp = BytesMut::new(bytes);
8398 #[allow(clippy::absurd_extreme_comparisons)]
8399 #[allow(unused_comparisons)]
8400 if __tmp.remaining() < Self::ENCODED_LEN {
8401 panic!(
8402 "buffer is too small (need {} bytes, but got {})",
8403 Self::ENCODED_LEN,
8404 __tmp.remaining(),
8405 )
8406 }
8407 __tmp.put_u8(self.gcs_system_id);
8408 __tmp.put_u8(self.control_request);
8409 __tmp.put_u8(self.ack);
8410 if matches!(version, MavlinkVersion::V2) {
8411 let len = __tmp.len();
8412 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8413 } else {
8414 __tmp.len()
8415 }
8416 }
8417}
8418#[doc = "id: 247"]
8419#[doc = "Information about a potential collision."]
8420#[derive(Debug, Clone, PartialEq)]
8421#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8422#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8423pub struct COLLISION_DATA {
8424 #[doc = "Unique identifier, domain based on src field"]
8425 pub id: u32,
8426 #[doc = "Estimated time until collision occurs"]
8427 pub time_to_minimum_delta: f32,
8428 #[doc = "Closest vertical distance between vehicle and object"]
8429 pub altitude_minimum_delta: f32,
8430 #[doc = "Closest horizontal distance between vehicle and object"]
8431 pub horizontal_minimum_delta: f32,
8432 #[doc = "Collision data source"]
8433 pub src: MavCollisionSrc,
8434 #[doc = "Action that is being taken to avoid this collision"]
8435 pub action: MavCollisionAction,
8436 #[doc = "How concerned the aircraft is about this collision"]
8437 pub threat_level: MavCollisionThreatLevel,
8438}
8439impl COLLISION_DATA {
8440 pub const ENCODED_LEN: usize = 19usize;
8441 pub const DEFAULT: Self = Self {
8442 id: 0_u32,
8443 time_to_minimum_delta: 0.0_f32,
8444 altitude_minimum_delta: 0.0_f32,
8445 horizontal_minimum_delta: 0.0_f32,
8446 src: MavCollisionSrc::DEFAULT,
8447 action: MavCollisionAction::DEFAULT,
8448 threat_level: MavCollisionThreatLevel::DEFAULT,
8449 };
8450 #[cfg(feature = "arbitrary")]
8451 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8452 use arbitrary::{Arbitrary, Unstructured};
8453 let mut buf = [0u8; 1024];
8454 rng.fill_bytes(&mut buf);
8455 let mut unstructured = Unstructured::new(&buf);
8456 Self::arbitrary(&mut unstructured).unwrap_or_default()
8457 }
8458}
8459impl Default for COLLISION_DATA {
8460 fn default() -> Self {
8461 Self::DEFAULT.clone()
8462 }
8463}
8464impl MessageData for COLLISION_DATA {
8465 type Message = MavMessage;
8466 const ID: u32 = 247u32;
8467 const NAME: &'static str = "COLLISION";
8468 const EXTRA_CRC: u8 = 81u8;
8469 const ENCODED_LEN: usize = 19usize;
8470 fn deser(
8471 _version: MavlinkVersion,
8472 __input: &[u8],
8473 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8474 let avail_len = __input.len();
8475 let mut payload_buf = [0; Self::ENCODED_LEN];
8476 let mut buf = if avail_len < Self::ENCODED_LEN {
8477 payload_buf[0..avail_len].copy_from_slice(__input);
8478 Bytes::new(&payload_buf)
8479 } else {
8480 Bytes::new(__input)
8481 };
8482 let mut __struct = Self::default();
8483 __struct.id = buf.get_u32_le();
8484 __struct.time_to_minimum_delta = buf.get_f32_le();
8485 __struct.altitude_minimum_delta = buf.get_f32_le();
8486 __struct.horizontal_minimum_delta = buf.get_f32_le();
8487 let tmp = buf.get_u8();
8488 __struct.src =
8489 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8490 enum_type: "MavCollisionSrc",
8491 value: tmp as u32,
8492 })?;
8493 let tmp = buf.get_u8();
8494 __struct.action =
8495 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8496 enum_type: "MavCollisionAction",
8497 value: tmp as u32,
8498 })?;
8499 let tmp = buf.get_u8();
8500 __struct.threat_level =
8501 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8502 enum_type: "MavCollisionThreatLevel",
8503 value: tmp as u32,
8504 })?;
8505 Ok(__struct)
8506 }
8507 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8508 let mut __tmp = BytesMut::new(bytes);
8509 #[allow(clippy::absurd_extreme_comparisons)]
8510 #[allow(unused_comparisons)]
8511 if __tmp.remaining() < Self::ENCODED_LEN {
8512 panic!(
8513 "buffer is too small (need {} bytes, but got {})",
8514 Self::ENCODED_LEN,
8515 __tmp.remaining(),
8516 )
8517 }
8518 __tmp.put_u32_le(self.id);
8519 __tmp.put_f32_le(self.time_to_minimum_delta);
8520 __tmp.put_f32_le(self.altitude_minimum_delta);
8521 __tmp.put_f32_le(self.horizontal_minimum_delta);
8522 __tmp.put_u8(self.src as u8);
8523 __tmp.put_u8(self.action as u8);
8524 __tmp.put_u8(self.threat_level as u8);
8525 if matches!(version, MavlinkVersion::V2) {
8526 let len = __tmp.len();
8527 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8528 } else {
8529 __tmp.len()
8530 }
8531 }
8532}
8533#[doc = "id: 77"]
8534#[doc = "Report status of a command. Includes feedback whether the command was executed. The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
8535#[derive(Debug, Clone, PartialEq)]
8536#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8537#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8538pub struct COMMAND_ACK_DATA {
8539 #[doc = "Command ID (of acknowledged command)."]
8540 pub command: MavCmd,
8541 #[doc = "Result of command."]
8542 pub result: MavResult,
8543 #[doc = "The progress percentage when result is MAV_RESULT_IN_PROGRESS. Values: [0-100], or UINT8_MAX if the progress is unknown."]
8544 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
8545 pub progress: u8,
8546 #[doc = "Additional result information. Can be set with a command-specific enum containing command-specific error reasons for why the command might be denied. If used, the associated enum must be documented in the corresponding MAV_CMD (this enum should have a 0 value to indicate \"unused\" or \"unknown\")."]
8547 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
8548 pub result_param2: i32,
8549 #[doc = "System ID of the target recipient. This is the ID of the system that sent the command for which this COMMAND_ACK is an acknowledgement."]
8550 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
8551 pub target_system: u8,
8552 #[doc = "Component ID of the target recipient. This is the ID of the system that sent the command for which this COMMAND_ACK is an acknowledgement."]
8553 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
8554 pub target_component: u8,
8555}
8556impl COMMAND_ACK_DATA {
8557 pub const ENCODED_LEN: usize = 10usize;
8558 pub const DEFAULT: Self = Self {
8559 command: MavCmd::DEFAULT,
8560 result: MavResult::DEFAULT,
8561 progress: 0_u8,
8562 result_param2: 0_i32,
8563 target_system: 0_u8,
8564 target_component: 0_u8,
8565 };
8566 #[cfg(feature = "arbitrary")]
8567 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8568 use arbitrary::{Arbitrary, Unstructured};
8569 let mut buf = [0u8; 1024];
8570 rng.fill_bytes(&mut buf);
8571 let mut unstructured = Unstructured::new(&buf);
8572 Self::arbitrary(&mut unstructured).unwrap_or_default()
8573 }
8574}
8575impl Default for COMMAND_ACK_DATA {
8576 fn default() -> Self {
8577 Self::DEFAULT.clone()
8578 }
8579}
8580impl MessageData for COMMAND_ACK_DATA {
8581 type Message = MavMessage;
8582 const ID: u32 = 77u32;
8583 const NAME: &'static str = "COMMAND_ACK";
8584 const EXTRA_CRC: u8 = 143u8;
8585 const ENCODED_LEN: usize = 10usize;
8586 fn deser(
8587 _version: MavlinkVersion,
8588 __input: &[u8],
8589 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8590 let avail_len = __input.len();
8591 let mut payload_buf = [0; Self::ENCODED_LEN];
8592 let mut buf = if avail_len < Self::ENCODED_LEN {
8593 payload_buf[0..avail_len].copy_from_slice(__input);
8594 Bytes::new(&payload_buf)
8595 } else {
8596 Bytes::new(__input)
8597 };
8598 let mut __struct = Self::default();
8599 let tmp = buf.get_u16_le();
8600 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
8601 ::mavlink_core::error::ParserError::InvalidEnum {
8602 enum_type: "MavCmd",
8603 value: tmp as u32,
8604 },
8605 )?;
8606 let tmp = buf.get_u8();
8607 __struct.result =
8608 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8609 enum_type: "MavResult",
8610 value: tmp as u32,
8611 })?;
8612 __struct.progress = buf.get_u8();
8613 __struct.result_param2 = buf.get_i32_le();
8614 __struct.target_system = buf.get_u8();
8615 __struct.target_component = buf.get_u8();
8616 Ok(__struct)
8617 }
8618 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8619 let mut __tmp = BytesMut::new(bytes);
8620 #[allow(clippy::absurd_extreme_comparisons)]
8621 #[allow(unused_comparisons)]
8622 if __tmp.remaining() < Self::ENCODED_LEN {
8623 panic!(
8624 "buffer is too small (need {} bytes, but got {})",
8625 Self::ENCODED_LEN,
8626 __tmp.remaining(),
8627 )
8628 }
8629 __tmp.put_u16_le(self.command as u16);
8630 __tmp.put_u8(self.result as u8);
8631 __tmp.put_u8(self.progress);
8632 __tmp.put_i32_le(self.result_param2);
8633 __tmp.put_u8(self.target_system);
8634 __tmp.put_u8(self.target_component);
8635 if matches!(version, MavlinkVersion::V2) {
8636 let len = __tmp.len();
8637 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8638 } else {
8639 __tmp.len()
8640 }
8641 }
8642}
8643#[doc = "id: 80"]
8644#[doc = "Cancel a long running command. The target system should respond with a COMMAND_ACK to the original command with result=MAV_RESULT_CANCELLED if the long running process was cancelled. If it has already completed, the cancel action can be ignored. The cancel action can be retried until some sort of acknowledgement to the original command has been received. The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
8645#[derive(Debug, Clone, PartialEq)]
8646#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8647#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8648pub struct COMMAND_CANCEL_DATA {
8649 #[doc = "Command ID (of command to cancel)."]
8650 pub command: MavCmd,
8651 #[doc = "System executing long running command. Should not be broadcast (0)."]
8652 pub target_system: u8,
8653 #[doc = "Component executing long running command."]
8654 pub target_component: u8,
8655}
8656impl COMMAND_CANCEL_DATA {
8657 pub const ENCODED_LEN: usize = 4usize;
8658 pub const DEFAULT: Self = Self {
8659 command: MavCmd::DEFAULT,
8660 target_system: 0_u8,
8661 target_component: 0_u8,
8662 };
8663 #[cfg(feature = "arbitrary")]
8664 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8665 use arbitrary::{Arbitrary, Unstructured};
8666 let mut buf = [0u8; 1024];
8667 rng.fill_bytes(&mut buf);
8668 let mut unstructured = Unstructured::new(&buf);
8669 Self::arbitrary(&mut unstructured).unwrap_or_default()
8670 }
8671}
8672impl Default for COMMAND_CANCEL_DATA {
8673 fn default() -> Self {
8674 Self::DEFAULT.clone()
8675 }
8676}
8677impl MessageData for COMMAND_CANCEL_DATA {
8678 type Message = MavMessage;
8679 const ID: u32 = 80u32;
8680 const NAME: &'static str = "COMMAND_CANCEL";
8681 const EXTRA_CRC: u8 = 14u8;
8682 const ENCODED_LEN: usize = 4usize;
8683 fn deser(
8684 _version: MavlinkVersion,
8685 __input: &[u8],
8686 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8687 let avail_len = __input.len();
8688 let mut payload_buf = [0; Self::ENCODED_LEN];
8689 let mut buf = if avail_len < Self::ENCODED_LEN {
8690 payload_buf[0..avail_len].copy_from_slice(__input);
8691 Bytes::new(&payload_buf)
8692 } else {
8693 Bytes::new(__input)
8694 };
8695 let mut __struct = Self::default();
8696 let tmp = buf.get_u16_le();
8697 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
8698 ::mavlink_core::error::ParserError::InvalidEnum {
8699 enum_type: "MavCmd",
8700 value: tmp as u32,
8701 },
8702 )?;
8703 __struct.target_system = buf.get_u8();
8704 __struct.target_component = buf.get_u8();
8705 Ok(__struct)
8706 }
8707 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8708 let mut __tmp = BytesMut::new(bytes);
8709 #[allow(clippy::absurd_extreme_comparisons)]
8710 #[allow(unused_comparisons)]
8711 if __tmp.remaining() < Self::ENCODED_LEN {
8712 panic!(
8713 "buffer is too small (need {} bytes, but got {})",
8714 Self::ENCODED_LEN,
8715 __tmp.remaining(),
8716 )
8717 }
8718 __tmp.put_u16_le(self.command as u16);
8719 __tmp.put_u8(self.target_system);
8720 __tmp.put_u8(self.target_component);
8721 if matches!(version, MavlinkVersion::V2) {
8722 let len = __tmp.len();
8723 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8724 } else {
8725 __tmp.len()
8726 }
8727 }
8728}
8729#[doc = "id: 75"]
8730#[doc = "Send a command with up to seven parameters to the MAV, where params 5 and 6 are integers and the other values are floats. This is preferred over COMMAND_LONG as it allows the MAV_FRAME to be specified for interpreting positional information, such as altitude. COMMAND_INT is also preferred when sending latitude and longitude data in params 5 and 6, as it allows for greater precision. Param 5 and 6 encode positional data as scaled integers, where the scaling depends on the actual command value. NaN or INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current latitude, yaw rather than a specific value). The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
8731#[derive(Debug, Clone, PartialEq)]
8732#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8733#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8734pub struct COMMAND_INT_DATA {
8735 #[doc = "PARAM1, see MAV_CMD enum"]
8736 pub param1: f32,
8737 #[doc = "PARAM2, see MAV_CMD enum"]
8738 pub param2: f32,
8739 #[doc = "PARAM3, see MAV_CMD enum"]
8740 pub param3: f32,
8741 #[doc = "PARAM4, see MAV_CMD enum"]
8742 pub param4: f32,
8743 #[doc = "PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7"]
8744 pub x: i32,
8745 #[doc = "PARAM6 / local: y position in meters * 1e4, global: longitude in degrees * 10^7"]
8746 pub y: i32,
8747 #[doc = "PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame)."]
8748 pub z: f32,
8749 #[doc = "The scheduled action for the mission item."]
8750 pub command: MavCmd,
8751 #[doc = "System ID"]
8752 pub target_system: u8,
8753 #[doc = "Component ID"]
8754 pub target_component: u8,
8755 #[doc = "The coordinate system of the COMMAND."]
8756 pub frame: MavFrame,
8757 #[doc = "Not used."]
8758 pub current: u8,
8759 #[doc = "Not used (set 0)."]
8760 pub autocontinue: u8,
8761}
8762impl COMMAND_INT_DATA {
8763 pub const ENCODED_LEN: usize = 35usize;
8764 pub const DEFAULT: Self = Self {
8765 param1: 0.0_f32,
8766 param2: 0.0_f32,
8767 param3: 0.0_f32,
8768 param4: 0.0_f32,
8769 x: 0_i32,
8770 y: 0_i32,
8771 z: 0.0_f32,
8772 command: MavCmd::DEFAULT,
8773 target_system: 0_u8,
8774 target_component: 0_u8,
8775 frame: MavFrame::DEFAULT,
8776 current: 0_u8,
8777 autocontinue: 0_u8,
8778 };
8779 #[cfg(feature = "arbitrary")]
8780 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8781 use arbitrary::{Arbitrary, Unstructured};
8782 let mut buf = [0u8; 1024];
8783 rng.fill_bytes(&mut buf);
8784 let mut unstructured = Unstructured::new(&buf);
8785 Self::arbitrary(&mut unstructured).unwrap_or_default()
8786 }
8787}
8788impl Default for COMMAND_INT_DATA {
8789 fn default() -> Self {
8790 Self::DEFAULT.clone()
8791 }
8792}
8793impl MessageData for COMMAND_INT_DATA {
8794 type Message = MavMessage;
8795 const ID: u32 = 75u32;
8796 const NAME: &'static str = "COMMAND_INT";
8797 const EXTRA_CRC: u8 = 158u8;
8798 const ENCODED_LEN: usize = 35usize;
8799 fn deser(
8800 _version: MavlinkVersion,
8801 __input: &[u8],
8802 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8803 let avail_len = __input.len();
8804 let mut payload_buf = [0; Self::ENCODED_LEN];
8805 let mut buf = if avail_len < Self::ENCODED_LEN {
8806 payload_buf[0..avail_len].copy_from_slice(__input);
8807 Bytes::new(&payload_buf)
8808 } else {
8809 Bytes::new(__input)
8810 };
8811 let mut __struct = Self::default();
8812 __struct.param1 = buf.get_f32_le();
8813 __struct.param2 = buf.get_f32_le();
8814 __struct.param3 = buf.get_f32_le();
8815 __struct.param4 = buf.get_f32_le();
8816 __struct.x = buf.get_i32_le();
8817 __struct.y = buf.get_i32_le();
8818 __struct.z = buf.get_f32_le();
8819 let tmp = buf.get_u16_le();
8820 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
8821 ::mavlink_core::error::ParserError::InvalidEnum {
8822 enum_type: "MavCmd",
8823 value: tmp as u32,
8824 },
8825 )?;
8826 __struct.target_system = buf.get_u8();
8827 __struct.target_component = buf.get_u8();
8828 let tmp = buf.get_u8();
8829 __struct.frame =
8830 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8831 enum_type: "MavFrame",
8832 value: tmp as u32,
8833 })?;
8834 __struct.current = buf.get_u8();
8835 __struct.autocontinue = buf.get_u8();
8836 Ok(__struct)
8837 }
8838 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8839 let mut __tmp = BytesMut::new(bytes);
8840 #[allow(clippy::absurd_extreme_comparisons)]
8841 #[allow(unused_comparisons)]
8842 if __tmp.remaining() < Self::ENCODED_LEN {
8843 panic!(
8844 "buffer is too small (need {} bytes, but got {})",
8845 Self::ENCODED_LEN,
8846 __tmp.remaining(),
8847 )
8848 }
8849 __tmp.put_f32_le(self.param1);
8850 __tmp.put_f32_le(self.param2);
8851 __tmp.put_f32_le(self.param3);
8852 __tmp.put_f32_le(self.param4);
8853 __tmp.put_i32_le(self.x);
8854 __tmp.put_i32_le(self.y);
8855 __tmp.put_f32_le(self.z);
8856 __tmp.put_u16_le(self.command as u16);
8857 __tmp.put_u8(self.target_system);
8858 __tmp.put_u8(self.target_component);
8859 __tmp.put_u8(self.frame as u8);
8860 __tmp.put_u8(self.current);
8861 __tmp.put_u8(self.autocontinue);
8862 if matches!(version, MavlinkVersion::V2) {
8863 let len = __tmp.len();
8864 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8865 } else {
8866 __tmp.len()
8867 }
8868 }
8869}
8870#[doc = "id: 76"]
8871#[doc = "Send a command with up to seven parameters to the MAV. COMMAND_INT is generally preferred when sending MAV_CMD commands that include positional information; it offers higher precision and allows the MAV_FRAME to be specified (which may otherwise be ambiguous, particularly for altitude). The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
8872#[derive(Debug, Clone, PartialEq)]
8873#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8874#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8875pub struct COMMAND_LONG_DATA {
8876 #[doc = "Parameter 1 (for the specific command)."]
8877 pub param1: f32,
8878 #[doc = "Parameter 2 (for the specific command)."]
8879 pub param2: f32,
8880 #[doc = "Parameter 3 (for the specific command)."]
8881 pub param3: f32,
8882 #[doc = "Parameter 4 (for the specific command)."]
8883 pub param4: f32,
8884 #[doc = "Parameter 5 (for the specific command)."]
8885 pub param5: f32,
8886 #[doc = "Parameter 6 (for the specific command)."]
8887 pub param6: f32,
8888 #[doc = "Parameter 7 (for the specific command)."]
8889 pub param7: f32,
8890 #[doc = "Command ID (of command to send)."]
8891 pub command: MavCmd,
8892 #[doc = "System which should execute the command"]
8893 pub target_system: u8,
8894 #[doc = "Component which should execute the command, 0 for all components"]
8895 pub target_component: u8,
8896 #[doc = "0: First transmission of this command. 1-255: Confirmation transmissions (e.g. for kill command)"]
8897 pub confirmation: u8,
8898}
8899impl COMMAND_LONG_DATA {
8900 pub const ENCODED_LEN: usize = 33usize;
8901 pub const DEFAULT: Self = Self {
8902 param1: 0.0_f32,
8903 param2: 0.0_f32,
8904 param3: 0.0_f32,
8905 param4: 0.0_f32,
8906 param5: 0.0_f32,
8907 param6: 0.0_f32,
8908 param7: 0.0_f32,
8909 command: MavCmd::DEFAULT,
8910 target_system: 0_u8,
8911 target_component: 0_u8,
8912 confirmation: 0_u8,
8913 };
8914 #[cfg(feature = "arbitrary")]
8915 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8916 use arbitrary::{Arbitrary, Unstructured};
8917 let mut buf = [0u8; 1024];
8918 rng.fill_bytes(&mut buf);
8919 let mut unstructured = Unstructured::new(&buf);
8920 Self::arbitrary(&mut unstructured).unwrap_or_default()
8921 }
8922}
8923impl Default for COMMAND_LONG_DATA {
8924 fn default() -> Self {
8925 Self::DEFAULT.clone()
8926 }
8927}
8928impl MessageData for COMMAND_LONG_DATA {
8929 type Message = MavMessage;
8930 const ID: u32 = 76u32;
8931 const NAME: &'static str = "COMMAND_LONG";
8932 const EXTRA_CRC: u8 = 152u8;
8933 const ENCODED_LEN: usize = 33usize;
8934 fn deser(
8935 _version: MavlinkVersion,
8936 __input: &[u8],
8937 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8938 let avail_len = __input.len();
8939 let mut payload_buf = [0; Self::ENCODED_LEN];
8940 let mut buf = if avail_len < Self::ENCODED_LEN {
8941 payload_buf[0..avail_len].copy_from_slice(__input);
8942 Bytes::new(&payload_buf)
8943 } else {
8944 Bytes::new(__input)
8945 };
8946 let mut __struct = Self::default();
8947 __struct.param1 = buf.get_f32_le();
8948 __struct.param2 = buf.get_f32_le();
8949 __struct.param3 = buf.get_f32_le();
8950 __struct.param4 = buf.get_f32_le();
8951 __struct.param5 = buf.get_f32_le();
8952 __struct.param6 = buf.get_f32_le();
8953 __struct.param7 = buf.get_f32_le();
8954 let tmp = buf.get_u16_le();
8955 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
8956 ::mavlink_core::error::ParserError::InvalidEnum {
8957 enum_type: "MavCmd",
8958 value: tmp as u32,
8959 },
8960 )?;
8961 __struct.target_system = buf.get_u8();
8962 __struct.target_component = buf.get_u8();
8963 __struct.confirmation = buf.get_u8();
8964 Ok(__struct)
8965 }
8966 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8967 let mut __tmp = BytesMut::new(bytes);
8968 #[allow(clippy::absurd_extreme_comparisons)]
8969 #[allow(unused_comparisons)]
8970 if __tmp.remaining() < Self::ENCODED_LEN {
8971 panic!(
8972 "buffer is too small (need {} bytes, but got {})",
8973 Self::ENCODED_LEN,
8974 __tmp.remaining(),
8975 )
8976 }
8977 __tmp.put_f32_le(self.param1);
8978 __tmp.put_f32_le(self.param2);
8979 __tmp.put_f32_le(self.param3);
8980 __tmp.put_f32_le(self.param4);
8981 __tmp.put_f32_le(self.param5);
8982 __tmp.put_f32_le(self.param6);
8983 __tmp.put_f32_le(self.param7);
8984 __tmp.put_u16_le(self.command as u16);
8985 __tmp.put_u8(self.target_system);
8986 __tmp.put_u8(self.target_component);
8987 __tmp.put_u8(self.confirmation);
8988 if matches!(version, MavlinkVersion::V2) {
8989 let len = __tmp.len();
8990 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8991 } else {
8992 __tmp.len()
8993 }
8994 }
8995}
8996#[deprecated = " See `COMPONENT_METADATA` (Deprecated since 2022-04)"]
8997#[doc = "id: 395"]
8998#[doc = "Component information message, which may be requested using MAV_CMD_REQUEST_MESSAGE."]
8999#[derive(Debug, Clone, PartialEq)]
9000#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9001#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9002pub struct COMPONENT_INFORMATION_DATA {
9003 #[doc = "Timestamp (time since system boot)."]
9004 pub time_boot_ms: u32,
9005 #[doc = "CRC32 of the general metadata file (general_metadata_uri)."]
9006 pub general_metadata_file_crc: u32,
9007 #[doc = "CRC32 of peripherals metadata file (peripherals_metadata_uri)."]
9008 pub peripherals_metadata_file_crc: u32,
9009 #[doc = "MAVLink FTP URI for the general metadata file (COMP_METADATA_TYPE_GENERAL), which may be compressed with xz. The file contains general component metadata, and may contain URI links for additional metadata (see COMP_METADATA_TYPE). The information is static from boot, and may be generated at compile time. The string needs to be zero terminated."]
9010 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9011 pub general_metadata_uri: [u8; 100],
9012 #[doc = "(Optional) MAVLink FTP URI for the peripherals metadata file (COMP_METADATA_TYPE_PERIPHERALS), which may be compressed with xz. This contains data about \"attached components\" such as UAVCAN nodes. The peripherals are in a separate file because the information must be generated dynamically at runtime. The string needs to be zero terminated."]
9013 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9014 pub peripherals_metadata_uri: [u8; 100],
9015}
9016impl COMPONENT_INFORMATION_DATA {
9017 pub const ENCODED_LEN: usize = 212usize;
9018 pub const DEFAULT: Self = Self {
9019 time_boot_ms: 0_u32,
9020 general_metadata_file_crc: 0_u32,
9021 peripherals_metadata_file_crc: 0_u32,
9022 general_metadata_uri: [0_u8; 100usize],
9023 peripherals_metadata_uri: [0_u8; 100usize],
9024 };
9025 #[cfg(feature = "arbitrary")]
9026 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9027 use arbitrary::{Arbitrary, Unstructured};
9028 let mut buf = [0u8; 1024];
9029 rng.fill_bytes(&mut buf);
9030 let mut unstructured = Unstructured::new(&buf);
9031 Self::arbitrary(&mut unstructured).unwrap_or_default()
9032 }
9033}
9034impl Default for COMPONENT_INFORMATION_DATA {
9035 fn default() -> Self {
9036 Self::DEFAULT.clone()
9037 }
9038}
9039impl MessageData for COMPONENT_INFORMATION_DATA {
9040 type Message = MavMessage;
9041 const ID: u32 = 395u32;
9042 const NAME: &'static str = "COMPONENT_INFORMATION";
9043 const EXTRA_CRC: u8 = 0u8;
9044 const ENCODED_LEN: usize = 212usize;
9045 fn deser(
9046 _version: MavlinkVersion,
9047 __input: &[u8],
9048 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9049 let avail_len = __input.len();
9050 let mut payload_buf = [0; Self::ENCODED_LEN];
9051 let mut buf = if avail_len < Self::ENCODED_LEN {
9052 payload_buf[0..avail_len].copy_from_slice(__input);
9053 Bytes::new(&payload_buf)
9054 } else {
9055 Bytes::new(__input)
9056 };
9057 let mut __struct = Self::default();
9058 __struct.time_boot_ms = buf.get_u32_le();
9059 __struct.general_metadata_file_crc = buf.get_u32_le();
9060 __struct.peripherals_metadata_file_crc = buf.get_u32_le();
9061 for v in &mut __struct.general_metadata_uri {
9062 let val = buf.get_u8();
9063 *v = val;
9064 }
9065 for v in &mut __struct.peripherals_metadata_uri {
9066 let val = buf.get_u8();
9067 *v = val;
9068 }
9069 Ok(__struct)
9070 }
9071 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9072 let mut __tmp = BytesMut::new(bytes);
9073 #[allow(clippy::absurd_extreme_comparisons)]
9074 #[allow(unused_comparisons)]
9075 if __tmp.remaining() < Self::ENCODED_LEN {
9076 panic!(
9077 "buffer is too small (need {} bytes, but got {})",
9078 Self::ENCODED_LEN,
9079 __tmp.remaining(),
9080 )
9081 }
9082 __tmp.put_u32_le(self.time_boot_ms);
9083 __tmp.put_u32_le(self.general_metadata_file_crc);
9084 __tmp.put_u32_le(self.peripherals_metadata_file_crc);
9085 for val in &self.general_metadata_uri {
9086 __tmp.put_u8(*val);
9087 }
9088 for val in &self.peripherals_metadata_uri {
9089 __tmp.put_u8(*val);
9090 }
9091 if matches!(version, MavlinkVersion::V2) {
9092 let len = __tmp.len();
9093 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9094 } else {
9095 __tmp.len()
9096 }
9097 }
9098}
9099#[doc = "id: 396"]
9100#[doc = "Basic component information data. Should be requested using MAV_CMD_REQUEST_MESSAGE on startup, or when required."]
9101#[derive(Debug, Clone, PartialEq)]
9102#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9103#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9104pub struct COMPONENT_INFORMATION_BASIC_DATA {
9105 #[doc = "Component capability flags"]
9106 pub capabilities: MavProtocolCapability,
9107 #[doc = "Timestamp (time since system boot)."]
9108 pub time_boot_ms: u32,
9109 #[doc = "Date of manufacture as a UNIX Epoch time (since 1.1.1970) in seconds."]
9110 pub time_manufacture_s: u32,
9111 #[doc = "Name of the component vendor. Needs to be zero terminated. The field is optional and can be empty/all zeros."]
9112 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9113 pub vendor_name: [u8; 32],
9114 #[doc = "Name of the component model. Needs to be zero terminated. The field is optional and can be empty/all zeros."]
9115 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9116 pub model_name: [u8; 32],
9117 #[doc = "Software version. The recommended format is SEMVER: 'major.minor.patch' (any format may be used). The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros."]
9118 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9119 pub software_version: [u8; 24],
9120 #[doc = "Hardware version. The recommended format is SEMVER: 'major.minor.patch' (any format may be used). The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros."]
9121 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9122 pub hardware_version: [u8; 24],
9123 #[doc = "Hardware serial number. The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros."]
9124 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9125 pub serial_number: [u8; 32],
9126}
9127impl COMPONENT_INFORMATION_BASIC_DATA {
9128 pub const ENCODED_LEN: usize = 160usize;
9129 pub const DEFAULT: Self = Self {
9130 capabilities: MavProtocolCapability::DEFAULT,
9131 time_boot_ms: 0_u32,
9132 time_manufacture_s: 0_u32,
9133 vendor_name: [0_u8; 32usize],
9134 model_name: [0_u8; 32usize],
9135 software_version: [0_u8; 24usize],
9136 hardware_version: [0_u8; 24usize],
9137 serial_number: [0_u8; 32usize],
9138 };
9139 #[cfg(feature = "arbitrary")]
9140 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9141 use arbitrary::{Arbitrary, Unstructured};
9142 let mut buf = [0u8; 1024];
9143 rng.fill_bytes(&mut buf);
9144 let mut unstructured = Unstructured::new(&buf);
9145 Self::arbitrary(&mut unstructured).unwrap_or_default()
9146 }
9147}
9148impl Default for COMPONENT_INFORMATION_BASIC_DATA {
9149 fn default() -> Self {
9150 Self::DEFAULT.clone()
9151 }
9152}
9153impl MessageData for COMPONENT_INFORMATION_BASIC_DATA {
9154 type Message = MavMessage;
9155 const ID: u32 = 396u32;
9156 const NAME: &'static str = "COMPONENT_INFORMATION_BASIC";
9157 const EXTRA_CRC: u8 = 50u8;
9158 const ENCODED_LEN: usize = 160usize;
9159 fn deser(
9160 _version: MavlinkVersion,
9161 __input: &[u8],
9162 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9163 let avail_len = __input.len();
9164 let mut payload_buf = [0; Self::ENCODED_LEN];
9165 let mut buf = if avail_len < Self::ENCODED_LEN {
9166 payload_buf[0..avail_len].copy_from_slice(__input);
9167 Bytes::new(&payload_buf)
9168 } else {
9169 Bytes::new(__input)
9170 };
9171 let mut __struct = Self::default();
9172 let tmp = buf.get_u64_le();
9173 __struct.capabilities = MavProtocolCapability::from_bits(
9174 tmp & MavProtocolCapability::all().bits(),
9175 )
9176 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
9177 flag_type: "MavProtocolCapability",
9178 value: tmp as u32,
9179 })?;
9180 __struct.time_boot_ms = buf.get_u32_le();
9181 __struct.time_manufacture_s = buf.get_u32_le();
9182 for v in &mut __struct.vendor_name {
9183 let val = buf.get_u8();
9184 *v = val;
9185 }
9186 for v in &mut __struct.model_name {
9187 let val = buf.get_u8();
9188 *v = val;
9189 }
9190 for v in &mut __struct.software_version {
9191 let val = buf.get_u8();
9192 *v = val;
9193 }
9194 for v in &mut __struct.hardware_version {
9195 let val = buf.get_u8();
9196 *v = val;
9197 }
9198 for v in &mut __struct.serial_number {
9199 let val = buf.get_u8();
9200 *v = val;
9201 }
9202 Ok(__struct)
9203 }
9204 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9205 let mut __tmp = BytesMut::new(bytes);
9206 #[allow(clippy::absurd_extreme_comparisons)]
9207 #[allow(unused_comparisons)]
9208 if __tmp.remaining() < Self::ENCODED_LEN {
9209 panic!(
9210 "buffer is too small (need {} bytes, but got {})",
9211 Self::ENCODED_LEN,
9212 __tmp.remaining(),
9213 )
9214 }
9215 __tmp.put_u64_le(self.capabilities.bits());
9216 __tmp.put_u32_le(self.time_boot_ms);
9217 __tmp.put_u32_le(self.time_manufacture_s);
9218 for val in &self.vendor_name {
9219 __tmp.put_u8(*val);
9220 }
9221 for val in &self.model_name {
9222 __tmp.put_u8(*val);
9223 }
9224 for val in &self.software_version {
9225 __tmp.put_u8(*val);
9226 }
9227 for val in &self.hardware_version {
9228 __tmp.put_u8(*val);
9229 }
9230 for val in &self.serial_number {
9231 __tmp.put_u8(*val);
9232 }
9233 if matches!(version, MavlinkVersion::V2) {
9234 let len = __tmp.len();
9235 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9236 } else {
9237 __tmp.len()
9238 }
9239 }
9240}
9241#[doc = "id: 397"]
9242#[doc = "Component metadata message, which may be requested using MAV_CMD_REQUEST_MESSAGE. This contains the MAVLink FTP URI and CRC for the component's general metadata file. The file must be hosted on the component, and may be xz compressed. The file CRC can be used for file caching. The general metadata file can be read to get the locations of other metadata files (COMP_METADATA_TYPE) and translations, which may be hosted either on the vehicle or the internet. For more information see: <https://mavlink.io/en/services/component_information.html>. Note: Camera components should use CAMERA_INFORMATION instead, and autopilots may use both this message and AUTOPILOT_VERSION."]
9243#[derive(Debug, Clone, PartialEq)]
9244#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9245#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9246pub struct COMPONENT_METADATA_DATA {
9247 #[doc = "Timestamp (time since system boot)."]
9248 pub time_boot_ms: u32,
9249 #[doc = "CRC32 of the general metadata file."]
9250 pub file_crc: u32,
9251 #[doc = "MAVLink FTP URI for the general metadata file (COMP_METADATA_TYPE_GENERAL), which may be compressed with xz. The file contains general component metadata, and may contain URI links for additional metadata (see COMP_METADATA_TYPE). The information is static from boot, and may be generated at compile time. The string needs to be zero terminated."]
9252 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9253 pub uri: [u8; 100],
9254}
9255impl COMPONENT_METADATA_DATA {
9256 pub const ENCODED_LEN: usize = 108usize;
9257 pub const DEFAULT: Self = Self {
9258 time_boot_ms: 0_u32,
9259 file_crc: 0_u32,
9260 uri: [0_u8; 100usize],
9261 };
9262 #[cfg(feature = "arbitrary")]
9263 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9264 use arbitrary::{Arbitrary, Unstructured};
9265 let mut buf = [0u8; 1024];
9266 rng.fill_bytes(&mut buf);
9267 let mut unstructured = Unstructured::new(&buf);
9268 Self::arbitrary(&mut unstructured).unwrap_or_default()
9269 }
9270}
9271impl Default for COMPONENT_METADATA_DATA {
9272 fn default() -> Self {
9273 Self::DEFAULT.clone()
9274 }
9275}
9276impl MessageData for COMPONENT_METADATA_DATA {
9277 type Message = MavMessage;
9278 const ID: u32 = 397u32;
9279 const NAME: &'static str = "COMPONENT_METADATA";
9280 const EXTRA_CRC: u8 = 182u8;
9281 const ENCODED_LEN: usize = 108usize;
9282 fn deser(
9283 _version: MavlinkVersion,
9284 __input: &[u8],
9285 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9286 let avail_len = __input.len();
9287 let mut payload_buf = [0; Self::ENCODED_LEN];
9288 let mut buf = if avail_len < Self::ENCODED_LEN {
9289 payload_buf[0..avail_len].copy_from_slice(__input);
9290 Bytes::new(&payload_buf)
9291 } else {
9292 Bytes::new(__input)
9293 };
9294 let mut __struct = Self::default();
9295 __struct.time_boot_ms = buf.get_u32_le();
9296 __struct.file_crc = buf.get_u32_le();
9297 for v in &mut __struct.uri {
9298 let val = buf.get_u8();
9299 *v = val;
9300 }
9301 Ok(__struct)
9302 }
9303 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9304 let mut __tmp = BytesMut::new(bytes);
9305 #[allow(clippy::absurd_extreme_comparisons)]
9306 #[allow(unused_comparisons)]
9307 if __tmp.remaining() < Self::ENCODED_LEN {
9308 panic!(
9309 "buffer is too small (need {} bytes, but got {})",
9310 Self::ENCODED_LEN,
9311 __tmp.remaining(),
9312 )
9313 }
9314 __tmp.put_u32_le(self.time_boot_ms);
9315 __tmp.put_u32_le(self.file_crc);
9316 for val in &self.uri {
9317 __tmp.put_u8(*val);
9318 }
9319 if matches!(version, MavlinkVersion::V2) {
9320 let len = __tmp.len();
9321 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9322 } else {
9323 __tmp.len()
9324 }
9325 }
9326}
9327#[doc = "id: 146"]
9328#[doc = "The smoothed, monotonic system state used to feed the control loops of the system."]
9329#[derive(Debug, Clone, PartialEq)]
9330#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9331#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9332pub struct CONTROL_SYSTEM_STATE_DATA {
9333 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
9334 pub time_usec: u64,
9335 #[doc = "X acceleration in body frame"]
9336 pub x_acc: f32,
9337 #[doc = "Y acceleration in body frame"]
9338 pub y_acc: f32,
9339 #[doc = "Z acceleration in body frame"]
9340 pub z_acc: f32,
9341 #[doc = "X velocity in body frame"]
9342 pub x_vel: f32,
9343 #[doc = "Y velocity in body frame"]
9344 pub y_vel: f32,
9345 #[doc = "Z velocity in body frame"]
9346 pub z_vel: f32,
9347 #[doc = "X position in local frame"]
9348 pub x_pos: f32,
9349 #[doc = "Y position in local frame"]
9350 pub y_pos: f32,
9351 #[doc = "Z position in local frame"]
9352 pub z_pos: f32,
9353 #[doc = "Airspeed, set to -1 if unknown"]
9354 pub airspeed: f32,
9355 #[doc = "Variance of body velocity estimate"]
9356 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9357 pub vel_variance: [f32; 3],
9358 #[doc = "Variance in local position"]
9359 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9360 pub pos_variance: [f32; 3],
9361 #[doc = "The attitude, represented as Quaternion"]
9362 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9363 pub q: [f32; 4],
9364 #[doc = "Angular rate in roll axis"]
9365 pub roll_rate: f32,
9366 #[doc = "Angular rate in pitch axis"]
9367 pub pitch_rate: f32,
9368 #[doc = "Angular rate in yaw axis"]
9369 pub yaw_rate: f32,
9370}
9371impl CONTROL_SYSTEM_STATE_DATA {
9372 pub const ENCODED_LEN: usize = 100usize;
9373 pub const DEFAULT: Self = Self {
9374 time_usec: 0_u64,
9375 x_acc: 0.0_f32,
9376 y_acc: 0.0_f32,
9377 z_acc: 0.0_f32,
9378 x_vel: 0.0_f32,
9379 y_vel: 0.0_f32,
9380 z_vel: 0.0_f32,
9381 x_pos: 0.0_f32,
9382 y_pos: 0.0_f32,
9383 z_pos: 0.0_f32,
9384 airspeed: 0.0_f32,
9385 vel_variance: [0.0_f32; 3usize],
9386 pos_variance: [0.0_f32; 3usize],
9387 q: [0.0_f32; 4usize],
9388 roll_rate: 0.0_f32,
9389 pitch_rate: 0.0_f32,
9390 yaw_rate: 0.0_f32,
9391 };
9392 #[cfg(feature = "arbitrary")]
9393 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9394 use arbitrary::{Arbitrary, Unstructured};
9395 let mut buf = [0u8; 1024];
9396 rng.fill_bytes(&mut buf);
9397 let mut unstructured = Unstructured::new(&buf);
9398 Self::arbitrary(&mut unstructured).unwrap_or_default()
9399 }
9400}
9401impl Default for CONTROL_SYSTEM_STATE_DATA {
9402 fn default() -> Self {
9403 Self::DEFAULT.clone()
9404 }
9405}
9406impl MessageData for CONTROL_SYSTEM_STATE_DATA {
9407 type Message = MavMessage;
9408 const ID: u32 = 146u32;
9409 const NAME: &'static str = "CONTROL_SYSTEM_STATE";
9410 const EXTRA_CRC: u8 = 103u8;
9411 const ENCODED_LEN: usize = 100usize;
9412 fn deser(
9413 _version: MavlinkVersion,
9414 __input: &[u8],
9415 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9416 let avail_len = __input.len();
9417 let mut payload_buf = [0; Self::ENCODED_LEN];
9418 let mut buf = if avail_len < Self::ENCODED_LEN {
9419 payload_buf[0..avail_len].copy_from_slice(__input);
9420 Bytes::new(&payload_buf)
9421 } else {
9422 Bytes::new(__input)
9423 };
9424 let mut __struct = Self::default();
9425 __struct.time_usec = buf.get_u64_le();
9426 __struct.x_acc = buf.get_f32_le();
9427 __struct.y_acc = buf.get_f32_le();
9428 __struct.z_acc = buf.get_f32_le();
9429 __struct.x_vel = buf.get_f32_le();
9430 __struct.y_vel = buf.get_f32_le();
9431 __struct.z_vel = buf.get_f32_le();
9432 __struct.x_pos = buf.get_f32_le();
9433 __struct.y_pos = buf.get_f32_le();
9434 __struct.z_pos = buf.get_f32_le();
9435 __struct.airspeed = buf.get_f32_le();
9436 for v in &mut __struct.vel_variance {
9437 let val = buf.get_f32_le();
9438 *v = val;
9439 }
9440 for v in &mut __struct.pos_variance {
9441 let val = buf.get_f32_le();
9442 *v = val;
9443 }
9444 for v in &mut __struct.q {
9445 let val = buf.get_f32_le();
9446 *v = val;
9447 }
9448 __struct.roll_rate = buf.get_f32_le();
9449 __struct.pitch_rate = buf.get_f32_le();
9450 __struct.yaw_rate = buf.get_f32_le();
9451 Ok(__struct)
9452 }
9453 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9454 let mut __tmp = BytesMut::new(bytes);
9455 #[allow(clippy::absurd_extreme_comparisons)]
9456 #[allow(unused_comparisons)]
9457 if __tmp.remaining() < Self::ENCODED_LEN {
9458 panic!(
9459 "buffer is too small (need {} bytes, but got {})",
9460 Self::ENCODED_LEN,
9461 __tmp.remaining(),
9462 )
9463 }
9464 __tmp.put_u64_le(self.time_usec);
9465 __tmp.put_f32_le(self.x_acc);
9466 __tmp.put_f32_le(self.y_acc);
9467 __tmp.put_f32_le(self.z_acc);
9468 __tmp.put_f32_le(self.x_vel);
9469 __tmp.put_f32_le(self.y_vel);
9470 __tmp.put_f32_le(self.z_vel);
9471 __tmp.put_f32_le(self.x_pos);
9472 __tmp.put_f32_le(self.y_pos);
9473 __tmp.put_f32_le(self.z_pos);
9474 __tmp.put_f32_le(self.airspeed);
9475 for val in &self.vel_variance {
9476 __tmp.put_f32_le(*val);
9477 }
9478 for val in &self.pos_variance {
9479 __tmp.put_f32_le(*val);
9480 }
9481 for val in &self.q {
9482 __tmp.put_f32_le(*val);
9483 }
9484 __tmp.put_f32_le(self.roll_rate);
9485 __tmp.put_f32_le(self.pitch_rate);
9486 __tmp.put_f32_le(self.yaw_rate);
9487 if matches!(version, MavlinkVersion::V2) {
9488 let len = __tmp.len();
9489 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9490 } else {
9491 __tmp.len()
9492 }
9493 }
9494}
9495#[doc = "id: 411"]
9496#[doc = "Regular broadcast for the current latest event sequence number for a component. This is used to check for dropped events."]
9497#[derive(Debug, Clone, PartialEq)]
9498#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9499#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9500pub struct CURRENT_EVENT_SEQUENCE_DATA {
9501 #[doc = "Sequence number."]
9502 pub sequence: u16,
9503 #[doc = "Flag bitset."]
9504 pub flags: MavEventCurrentSequenceFlags,
9505}
9506impl CURRENT_EVENT_SEQUENCE_DATA {
9507 pub const ENCODED_LEN: usize = 3usize;
9508 pub const DEFAULT: Self = Self {
9509 sequence: 0_u16,
9510 flags: MavEventCurrentSequenceFlags::DEFAULT,
9511 };
9512 #[cfg(feature = "arbitrary")]
9513 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9514 use arbitrary::{Arbitrary, Unstructured};
9515 let mut buf = [0u8; 1024];
9516 rng.fill_bytes(&mut buf);
9517 let mut unstructured = Unstructured::new(&buf);
9518 Self::arbitrary(&mut unstructured).unwrap_or_default()
9519 }
9520}
9521impl Default for CURRENT_EVENT_SEQUENCE_DATA {
9522 fn default() -> Self {
9523 Self::DEFAULT.clone()
9524 }
9525}
9526impl MessageData for CURRENT_EVENT_SEQUENCE_DATA {
9527 type Message = MavMessage;
9528 const ID: u32 = 411u32;
9529 const NAME: &'static str = "CURRENT_EVENT_SEQUENCE";
9530 const EXTRA_CRC: u8 = 106u8;
9531 const ENCODED_LEN: usize = 3usize;
9532 fn deser(
9533 _version: MavlinkVersion,
9534 __input: &[u8],
9535 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9536 let avail_len = __input.len();
9537 let mut payload_buf = [0; Self::ENCODED_LEN];
9538 let mut buf = if avail_len < Self::ENCODED_LEN {
9539 payload_buf[0..avail_len].copy_from_slice(__input);
9540 Bytes::new(&payload_buf)
9541 } else {
9542 Bytes::new(__input)
9543 };
9544 let mut __struct = Self::default();
9545 __struct.sequence = buf.get_u16_le();
9546 let tmp = buf.get_u8();
9547 __struct.flags =
9548 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9549 enum_type: "MavEventCurrentSequenceFlags",
9550 value: tmp as u32,
9551 })?;
9552 Ok(__struct)
9553 }
9554 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9555 let mut __tmp = BytesMut::new(bytes);
9556 #[allow(clippy::absurd_extreme_comparisons)]
9557 #[allow(unused_comparisons)]
9558 if __tmp.remaining() < Self::ENCODED_LEN {
9559 panic!(
9560 "buffer is too small (need {} bytes, but got {})",
9561 Self::ENCODED_LEN,
9562 __tmp.remaining(),
9563 )
9564 }
9565 __tmp.put_u16_le(self.sequence);
9566 __tmp.put_u8(self.flags as u8);
9567 if matches!(version, MavlinkVersion::V2) {
9568 let len = __tmp.len();
9569 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9570 } else {
9571 __tmp.len()
9572 }
9573 }
9574}
9575#[doc = "id: 436"]
9576#[doc = "Get the current mode. This should be emitted on any mode change, and broadcast at low rate (nominally 0.5 Hz). It may be requested using MAV_CMD_REQUEST_MESSAGE. See <https://mavlink.io/en/services/standard_modes.html>."]
9577#[derive(Debug, Clone, PartialEq)]
9578#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9579#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9580pub struct CURRENT_MODE_DATA {
9581 #[doc = "A bitfield for use for autopilot-specific flags"]
9582 pub custom_mode: u32,
9583 #[doc = "The custom_mode of the mode that was last commanded by the user (for example, with MAV_CMD_DO_SET_STANDARD_MODE, MAV_CMD_DO_SET_MODE or via RC). This should usually be the same as custom_mode. It will be different if the vehicle is unable to enter the intended mode, or has left that mode due to a failsafe condition. 0 indicates the intended custom mode is unknown/not supplied"]
9584 pub intended_custom_mode: u32,
9585 #[doc = "Standard mode."]
9586 pub standard_mode: MavStandardMode,
9587}
9588impl CURRENT_MODE_DATA {
9589 pub const ENCODED_LEN: usize = 9usize;
9590 pub const DEFAULT: Self = Self {
9591 custom_mode: 0_u32,
9592 intended_custom_mode: 0_u32,
9593 standard_mode: MavStandardMode::DEFAULT,
9594 };
9595 #[cfg(feature = "arbitrary")]
9596 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9597 use arbitrary::{Arbitrary, Unstructured};
9598 let mut buf = [0u8; 1024];
9599 rng.fill_bytes(&mut buf);
9600 let mut unstructured = Unstructured::new(&buf);
9601 Self::arbitrary(&mut unstructured).unwrap_or_default()
9602 }
9603}
9604impl Default for CURRENT_MODE_DATA {
9605 fn default() -> Self {
9606 Self::DEFAULT.clone()
9607 }
9608}
9609impl MessageData for CURRENT_MODE_DATA {
9610 type Message = MavMessage;
9611 const ID: u32 = 436u32;
9612 const NAME: &'static str = "CURRENT_MODE";
9613 const EXTRA_CRC: u8 = 193u8;
9614 const ENCODED_LEN: usize = 9usize;
9615 fn deser(
9616 _version: MavlinkVersion,
9617 __input: &[u8],
9618 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9619 let avail_len = __input.len();
9620 let mut payload_buf = [0; Self::ENCODED_LEN];
9621 let mut buf = if avail_len < Self::ENCODED_LEN {
9622 payload_buf[0..avail_len].copy_from_slice(__input);
9623 Bytes::new(&payload_buf)
9624 } else {
9625 Bytes::new(__input)
9626 };
9627 let mut __struct = Self::default();
9628 __struct.custom_mode = buf.get_u32_le();
9629 __struct.intended_custom_mode = buf.get_u32_le();
9630 let tmp = buf.get_u8();
9631 __struct.standard_mode =
9632 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9633 enum_type: "MavStandardMode",
9634 value: tmp as u32,
9635 })?;
9636 Ok(__struct)
9637 }
9638 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9639 let mut __tmp = BytesMut::new(bytes);
9640 #[allow(clippy::absurd_extreme_comparisons)]
9641 #[allow(unused_comparisons)]
9642 if __tmp.remaining() < Self::ENCODED_LEN {
9643 panic!(
9644 "buffer is too small (need {} bytes, but got {})",
9645 Self::ENCODED_LEN,
9646 __tmp.remaining(),
9647 )
9648 }
9649 __tmp.put_u32_le(self.custom_mode);
9650 __tmp.put_u32_le(self.intended_custom_mode);
9651 __tmp.put_u8(self.standard_mode as u8);
9652 if matches!(version, MavlinkVersion::V2) {
9653 let len = __tmp.len();
9654 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9655 } else {
9656 __tmp.len()
9657 }
9658 }
9659}
9660#[deprecated = " See `MESSAGE_INTERVAL` (Deprecated since 2015-08)"]
9661#[doc = "id: 67"]
9662#[doc = "Data stream status information."]
9663#[derive(Debug, Clone, PartialEq)]
9664#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9665#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9666pub struct DATA_STREAM_DATA {
9667 #[doc = "The message rate"]
9668 pub message_rate: u16,
9669 #[doc = "The ID of the requested data stream"]
9670 pub stream_id: u8,
9671 #[doc = "1 stream is enabled, 0 stream is stopped."]
9672 pub on_off: u8,
9673}
9674impl DATA_STREAM_DATA {
9675 pub const ENCODED_LEN: usize = 4usize;
9676 pub const DEFAULT: Self = Self {
9677 message_rate: 0_u16,
9678 stream_id: 0_u8,
9679 on_off: 0_u8,
9680 };
9681 #[cfg(feature = "arbitrary")]
9682 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9683 use arbitrary::{Arbitrary, Unstructured};
9684 let mut buf = [0u8; 1024];
9685 rng.fill_bytes(&mut buf);
9686 let mut unstructured = Unstructured::new(&buf);
9687 Self::arbitrary(&mut unstructured).unwrap_or_default()
9688 }
9689}
9690impl Default for DATA_STREAM_DATA {
9691 fn default() -> Self {
9692 Self::DEFAULT.clone()
9693 }
9694}
9695impl MessageData for DATA_STREAM_DATA {
9696 type Message = MavMessage;
9697 const ID: u32 = 67u32;
9698 const NAME: &'static str = "DATA_STREAM";
9699 const EXTRA_CRC: u8 = 21u8;
9700 const ENCODED_LEN: usize = 4usize;
9701 fn deser(
9702 _version: MavlinkVersion,
9703 __input: &[u8],
9704 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9705 let avail_len = __input.len();
9706 let mut payload_buf = [0; Self::ENCODED_LEN];
9707 let mut buf = if avail_len < Self::ENCODED_LEN {
9708 payload_buf[0..avail_len].copy_from_slice(__input);
9709 Bytes::new(&payload_buf)
9710 } else {
9711 Bytes::new(__input)
9712 };
9713 let mut __struct = Self::default();
9714 __struct.message_rate = buf.get_u16_le();
9715 __struct.stream_id = buf.get_u8();
9716 __struct.on_off = buf.get_u8();
9717 Ok(__struct)
9718 }
9719 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9720 let mut __tmp = BytesMut::new(bytes);
9721 #[allow(clippy::absurd_extreme_comparisons)]
9722 #[allow(unused_comparisons)]
9723 if __tmp.remaining() < Self::ENCODED_LEN {
9724 panic!(
9725 "buffer is too small (need {} bytes, but got {})",
9726 Self::ENCODED_LEN,
9727 __tmp.remaining(),
9728 )
9729 }
9730 __tmp.put_u16_le(self.message_rate);
9731 __tmp.put_u8(self.stream_id);
9732 __tmp.put_u8(self.on_off);
9733 if matches!(version, MavlinkVersion::V2) {
9734 let len = __tmp.len();
9735 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9736 } else {
9737 __tmp.len()
9738 }
9739 }
9740}
9741#[doc = "id: 130"]
9742#[doc = "Handshake message to initiate, control and stop image streaming when using the Image Transmission Protocol: <https://mavlink.io/en/services/image_transmission.html>."]
9743#[derive(Debug, Clone, PartialEq)]
9744#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9745#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9746pub struct DATA_TRANSMISSION_HANDSHAKE_DATA {
9747 #[doc = "total data size (set on ACK only)."]
9748 pub size: u32,
9749 #[doc = "Width of a matrix or image."]
9750 pub width: u16,
9751 #[doc = "Height of a matrix or image."]
9752 pub height: u16,
9753 #[doc = "Number of packets being sent (set on ACK only)."]
9754 pub packets: u16,
9755 #[doc = "Type of requested/acknowledged data."]
9756 pub mavtype: MavlinkDataStreamType,
9757 #[doc = "Payload size per packet (normally 253 byte, see DATA field size in message ENCAPSULATED_DATA) (set on ACK only)."]
9758 pub payload: u8,
9759 #[doc = "JPEG quality. Values: [1-100]."]
9760 pub jpg_quality: u8,
9761}
9762impl DATA_TRANSMISSION_HANDSHAKE_DATA {
9763 pub const ENCODED_LEN: usize = 13usize;
9764 pub const DEFAULT: Self = Self {
9765 size: 0_u32,
9766 width: 0_u16,
9767 height: 0_u16,
9768 packets: 0_u16,
9769 mavtype: MavlinkDataStreamType::DEFAULT,
9770 payload: 0_u8,
9771 jpg_quality: 0_u8,
9772 };
9773 #[cfg(feature = "arbitrary")]
9774 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9775 use arbitrary::{Arbitrary, Unstructured};
9776 let mut buf = [0u8; 1024];
9777 rng.fill_bytes(&mut buf);
9778 let mut unstructured = Unstructured::new(&buf);
9779 Self::arbitrary(&mut unstructured).unwrap_or_default()
9780 }
9781}
9782impl Default for DATA_TRANSMISSION_HANDSHAKE_DATA {
9783 fn default() -> Self {
9784 Self::DEFAULT.clone()
9785 }
9786}
9787impl MessageData for DATA_TRANSMISSION_HANDSHAKE_DATA {
9788 type Message = MavMessage;
9789 const ID: u32 = 130u32;
9790 const NAME: &'static str = "DATA_TRANSMISSION_HANDSHAKE";
9791 const EXTRA_CRC: u8 = 29u8;
9792 const ENCODED_LEN: usize = 13usize;
9793 fn deser(
9794 _version: MavlinkVersion,
9795 __input: &[u8],
9796 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9797 let avail_len = __input.len();
9798 let mut payload_buf = [0; Self::ENCODED_LEN];
9799 let mut buf = if avail_len < Self::ENCODED_LEN {
9800 payload_buf[0..avail_len].copy_from_slice(__input);
9801 Bytes::new(&payload_buf)
9802 } else {
9803 Bytes::new(__input)
9804 };
9805 let mut __struct = Self::default();
9806 __struct.size = buf.get_u32_le();
9807 __struct.width = buf.get_u16_le();
9808 __struct.height = buf.get_u16_le();
9809 __struct.packets = buf.get_u16_le();
9810 let tmp = buf.get_u8();
9811 __struct.mavtype =
9812 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9813 enum_type: "MavlinkDataStreamType",
9814 value: tmp as u32,
9815 })?;
9816 __struct.payload = buf.get_u8();
9817 __struct.jpg_quality = buf.get_u8();
9818 Ok(__struct)
9819 }
9820 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9821 let mut __tmp = BytesMut::new(bytes);
9822 #[allow(clippy::absurd_extreme_comparisons)]
9823 #[allow(unused_comparisons)]
9824 if __tmp.remaining() < Self::ENCODED_LEN {
9825 panic!(
9826 "buffer is too small (need {} bytes, but got {})",
9827 Self::ENCODED_LEN,
9828 __tmp.remaining(),
9829 )
9830 }
9831 __tmp.put_u32_le(self.size);
9832 __tmp.put_u16_le(self.width);
9833 __tmp.put_u16_le(self.height);
9834 __tmp.put_u16_le(self.packets);
9835 __tmp.put_u8(self.mavtype as u8);
9836 __tmp.put_u8(self.payload);
9837 __tmp.put_u8(self.jpg_quality);
9838 if matches!(version, MavlinkVersion::V2) {
9839 let len = __tmp.len();
9840 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9841 } else {
9842 __tmp.len()
9843 }
9844 }
9845}
9846#[doc = "id: 254"]
9847#[doc = "Send a debug value. The index is used to discriminate between values. These values show up in the plot of QGroundControl as DEBUG N."]
9848#[derive(Debug, Clone, PartialEq)]
9849#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9850#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9851pub struct DEBUG_DATA {
9852 #[doc = "Timestamp (time since system boot)."]
9853 pub time_boot_ms: u32,
9854 #[doc = "DEBUG value"]
9855 pub value: f32,
9856 #[doc = "index of debug variable"]
9857 pub ind: u8,
9858}
9859impl DEBUG_DATA {
9860 pub const ENCODED_LEN: usize = 9usize;
9861 pub const DEFAULT: Self = Self {
9862 time_boot_ms: 0_u32,
9863 value: 0.0_f32,
9864 ind: 0_u8,
9865 };
9866 #[cfg(feature = "arbitrary")]
9867 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9868 use arbitrary::{Arbitrary, Unstructured};
9869 let mut buf = [0u8; 1024];
9870 rng.fill_bytes(&mut buf);
9871 let mut unstructured = Unstructured::new(&buf);
9872 Self::arbitrary(&mut unstructured).unwrap_or_default()
9873 }
9874}
9875impl Default for DEBUG_DATA {
9876 fn default() -> Self {
9877 Self::DEFAULT.clone()
9878 }
9879}
9880impl MessageData for DEBUG_DATA {
9881 type Message = MavMessage;
9882 const ID: u32 = 254u32;
9883 const NAME: &'static str = "DEBUG";
9884 const EXTRA_CRC: u8 = 46u8;
9885 const ENCODED_LEN: usize = 9usize;
9886 fn deser(
9887 _version: MavlinkVersion,
9888 __input: &[u8],
9889 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9890 let avail_len = __input.len();
9891 let mut payload_buf = [0; Self::ENCODED_LEN];
9892 let mut buf = if avail_len < Self::ENCODED_LEN {
9893 payload_buf[0..avail_len].copy_from_slice(__input);
9894 Bytes::new(&payload_buf)
9895 } else {
9896 Bytes::new(__input)
9897 };
9898 let mut __struct = Self::default();
9899 __struct.time_boot_ms = buf.get_u32_le();
9900 __struct.value = buf.get_f32_le();
9901 __struct.ind = buf.get_u8();
9902 Ok(__struct)
9903 }
9904 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9905 let mut __tmp = BytesMut::new(bytes);
9906 #[allow(clippy::absurd_extreme_comparisons)]
9907 #[allow(unused_comparisons)]
9908 if __tmp.remaining() < Self::ENCODED_LEN {
9909 panic!(
9910 "buffer is too small (need {} bytes, but got {})",
9911 Self::ENCODED_LEN,
9912 __tmp.remaining(),
9913 )
9914 }
9915 __tmp.put_u32_le(self.time_boot_ms);
9916 __tmp.put_f32_le(self.value);
9917 __tmp.put_u8(self.ind);
9918 if matches!(version, MavlinkVersion::V2) {
9919 let len = __tmp.len();
9920 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9921 } else {
9922 __tmp.len()
9923 }
9924 }
9925}
9926#[doc = "id: 350"]
9927#[doc = "Large debug/prototyping array. The message uses the maximum available payload for data. The array_id and name fields are used to discriminate between messages in code and in user interfaces (respectively). Do not use in production code."]
9928#[derive(Debug, Clone, PartialEq)]
9929#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9930#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9931pub struct DEBUG_FLOAT_ARRAY_DATA {
9932 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
9933 pub time_usec: u64,
9934 #[doc = "Unique ID used to discriminate between arrays"]
9935 pub array_id: u16,
9936 #[doc = "Name, for human-friendly display in a Ground Control Station"]
9937 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9938 pub name: [u8; 10],
9939 #[doc = "data"]
9940 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
9941 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9942 pub data: [f32; 58],
9943}
9944impl DEBUG_FLOAT_ARRAY_DATA {
9945 pub const ENCODED_LEN: usize = 252usize;
9946 pub const DEFAULT: Self = Self {
9947 time_usec: 0_u64,
9948 array_id: 0_u16,
9949 name: [0_u8; 10usize],
9950 data: [0.0_f32; 58usize],
9951 };
9952 #[cfg(feature = "arbitrary")]
9953 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9954 use arbitrary::{Arbitrary, Unstructured};
9955 let mut buf = [0u8; 1024];
9956 rng.fill_bytes(&mut buf);
9957 let mut unstructured = Unstructured::new(&buf);
9958 Self::arbitrary(&mut unstructured).unwrap_or_default()
9959 }
9960}
9961impl Default for DEBUG_FLOAT_ARRAY_DATA {
9962 fn default() -> Self {
9963 Self::DEFAULT.clone()
9964 }
9965}
9966impl MessageData for DEBUG_FLOAT_ARRAY_DATA {
9967 type Message = MavMessage;
9968 const ID: u32 = 350u32;
9969 const NAME: &'static str = "DEBUG_FLOAT_ARRAY";
9970 const EXTRA_CRC: u8 = 232u8;
9971 const ENCODED_LEN: usize = 252usize;
9972 fn deser(
9973 _version: MavlinkVersion,
9974 __input: &[u8],
9975 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9976 let avail_len = __input.len();
9977 let mut payload_buf = [0; Self::ENCODED_LEN];
9978 let mut buf = if avail_len < Self::ENCODED_LEN {
9979 payload_buf[0..avail_len].copy_from_slice(__input);
9980 Bytes::new(&payload_buf)
9981 } else {
9982 Bytes::new(__input)
9983 };
9984 let mut __struct = Self::default();
9985 __struct.time_usec = buf.get_u64_le();
9986 __struct.array_id = buf.get_u16_le();
9987 for v in &mut __struct.name {
9988 let val = buf.get_u8();
9989 *v = val;
9990 }
9991 for v in &mut __struct.data {
9992 let val = buf.get_f32_le();
9993 *v = val;
9994 }
9995 Ok(__struct)
9996 }
9997 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9998 let mut __tmp = BytesMut::new(bytes);
9999 #[allow(clippy::absurd_extreme_comparisons)]
10000 #[allow(unused_comparisons)]
10001 if __tmp.remaining() < Self::ENCODED_LEN {
10002 panic!(
10003 "buffer is too small (need {} bytes, but got {})",
10004 Self::ENCODED_LEN,
10005 __tmp.remaining(),
10006 )
10007 }
10008 __tmp.put_u64_le(self.time_usec);
10009 __tmp.put_u16_le(self.array_id);
10010 for val in &self.name {
10011 __tmp.put_u8(*val);
10012 }
10013 for val in &self.data {
10014 __tmp.put_f32_le(*val);
10015 }
10016 if matches!(version, MavlinkVersion::V2) {
10017 let len = __tmp.len();
10018 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10019 } else {
10020 __tmp.len()
10021 }
10022 }
10023}
10024#[doc = "id: 250"]
10025#[doc = "To debug something using a named 3D vector."]
10026#[derive(Debug, Clone, PartialEq)]
10027#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10028#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10029pub struct DEBUG_VECT_DATA {
10030 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
10031 pub time_usec: u64,
10032 #[doc = "x"]
10033 pub x: f32,
10034 #[doc = "y"]
10035 pub y: f32,
10036 #[doc = "z"]
10037 pub z: f32,
10038 #[doc = "Name"]
10039 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10040 pub name: [u8; 10],
10041}
10042impl DEBUG_VECT_DATA {
10043 pub const ENCODED_LEN: usize = 30usize;
10044 pub const DEFAULT: Self = Self {
10045 time_usec: 0_u64,
10046 x: 0.0_f32,
10047 y: 0.0_f32,
10048 z: 0.0_f32,
10049 name: [0_u8; 10usize],
10050 };
10051 #[cfg(feature = "arbitrary")]
10052 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10053 use arbitrary::{Arbitrary, Unstructured};
10054 let mut buf = [0u8; 1024];
10055 rng.fill_bytes(&mut buf);
10056 let mut unstructured = Unstructured::new(&buf);
10057 Self::arbitrary(&mut unstructured).unwrap_or_default()
10058 }
10059}
10060impl Default for DEBUG_VECT_DATA {
10061 fn default() -> Self {
10062 Self::DEFAULT.clone()
10063 }
10064}
10065impl MessageData for DEBUG_VECT_DATA {
10066 type Message = MavMessage;
10067 const ID: u32 = 250u32;
10068 const NAME: &'static str = "DEBUG_VECT";
10069 const EXTRA_CRC: u8 = 49u8;
10070 const ENCODED_LEN: usize = 30usize;
10071 fn deser(
10072 _version: MavlinkVersion,
10073 __input: &[u8],
10074 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10075 let avail_len = __input.len();
10076 let mut payload_buf = [0; Self::ENCODED_LEN];
10077 let mut buf = if avail_len < Self::ENCODED_LEN {
10078 payload_buf[0..avail_len].copy_from_slice(__input);
10079 Bytes::new(&payload_buf)
10080 } else {
10081 Bytes::new(__input)
10082 };
10083 let mut __struct = Self::default();
10084 __struct.time_usec = buf.get_u64_le();
10085 __struct.x = buf.get_f32_le();
10086 __struct.y = buf.get_f32_le();
10087 __struct.z = buf.get_f32_le();
10088 for v in &mut __struct.name {
10089 let val = buf.get_u8();
10090 *v = val;
10091 }
10092 Ok(__struct)
10093 }
10094 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10095 let mut __tmp = BytesMut::new(bytes);
10096 #[allow(clippy::absurd_extreme_comparisons)]
10097 #[allow(unused_comparisons)]
10098 if __tmp.remaining() < Self::ENCODED_LEN {
10099 panic!(
10100 "buffer is too small (need {} bytes, but got {})",
10101 Self::ENCODED_LEN,
10102 __tmp.remaining(),
10103 )
10104 }
10105 __tmp.put_u64_le(self.time_usec);
10106 __tmp.put_f32_le(self.x);
10107 __tmp.put_f32_le(self.y);
10108 __tmp.put_f32_le(self.z);
10109 for val in &self.name {
10110 __tmp.put_u8(*val);
10111 }
10112 if matches!(version, MavlinkVersion::V2) {
10113 let len = __tmp.len();
10114 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10115 } else {
10116 __tmp.len()
10117 }
10118 }
10119}
10120#[doc = "id: 132"]
10121#[doc = "Distance sensor information for an onboard rangefinder."]
10122#[derive(Debug, Clone, PartialEq)]
10123#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10124#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10125pub struct DISTANCE_SENSOR_DATA {
10126 #[doc = "Timestamp (time since system boot)."]
10127 pub time_boot_ms: u32,
10128 #[doc = "Minimum distance the sensor can measure"]
10129 pub min_distance: u16,
10130 #[doc = "Maximum distance the sensor can measure"]
10131 pub max_distance: u16,
10132 #[doc = "Current distance reading"]
10133 pub current_distance: u16,
10134 #[doc = "Type of distance sensor."]
10135 pub mavtype: MavDistanceSensor,
10136 #[doc = "Onboard ID of the sensor"]
10137 pub id: u8,
10138 #[doc = "Direction the sensor faces. downward-facing: ROTATION_PITCH_270, upward-facing: ROTATION_PITCH_90, backward-facing: ROTATION_PITCH_180, forward-facing: ROTATION_NONE, left-facing: ROTATION_YAW_90, right-facing: ROTATION_YAW_270"]
10139 pub orientation: MavSensorOrientation,
10140 #[doc = "Measurement variance. Max standard deviation is 6cm. UINT8_MAX if unknown."]
10141 pub covariance: u8,
10142 #[doc = "Horizontal Field of View (angle) where the distance measurement is valid and the field of view is known. Otherwise this is set to 0."]
10143 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10144 pub horizontal_fov: f32,
10145 #[doc = "Vertical Field of View (angle) where the distance measurement is valid and the field of view is known. Otherwise this is set to 0."]
10146 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10147 pub vertical_fov: f32,
10148 #[doc = "Quaternion of the sensor orientation in vehicle body frame (w, x, y, z order, zero-rotation is 1, 0, 0, 0). Zero-rotation is along the vehicle body x-axis. This field is required if the orientation is set to MAV_SENSOR_ROTATION_CUSTOM. Set it to 0 if invalid.\""]
10149 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10150 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10151 pub quaternion: [f32; 4],
10152 #[doc = "Signal quality of the sensor. Specific to each sensor type, representing the relation of the signal strength with the target reflectivity, distance, size or aspect, but normalised as a percentage. 0 = unknown/unset signal quality, 1 = invalid signal, 100 = perfect signal."]
10153 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10154 pub signal_quality: u8,
10155}
10156impl DISTANCE_SENSOR_DATA {
10157 pub const ENCODED_LEN: usize = 39usize;
10158 pub const DEFAULT: Self = Self {
10159 time_boot_ms: 0_u32,
10160 min_distance: 0_u16,
10161 max_distance: 0_u16,
10162 current_distance: 0_u16,
10163 mavtype: MavDistanceSensor::DEFAULT,
10164 id: 0_u8,
10165 orientation: MavSensorOrientation::DEFAULT,
10166 covariance: 0_u8,
10167 horizontal_fov: 0.0_f32,
10168 vertical_fov: 0.0_f32,
10169 quaternion: [0.0_f32; 4usize],
10170 signal_quality: 0_u8,
10171 };
10172 #[cfg(feature = "arbitrary")]
10173 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10174 use arbitrary::{Arbitrary, Unstructured};
10175 let mut buf = [0u8; 1024];
10176 rng.fill_bytes(&mut buf);
10177 let mut unstructured = Unstructured::new(&buf);
10178 Self::arbitrary(&mut unstructured).unwrap_or_default()
10179 }
10180}
10181impl Default for DISTANCE_SENSOR_DATA {
10182 fn default() -> Self {
10183 Self::DEFAULT.clone()
10184 }
10185}
10186impl MessageData for DISTANCE_SENSOR_DATA {
10187 type Message = MavMessage;
10188 const ID: u32 = 132u32;
10189 const NAME: &'static str = "DISTANCE_SENSOR";
10190 const EXTRA_CRC: u8 = 85u8;
10191 const ENCODED_LEN: usize = 39usize;
10192 fn deser(
10193 _version: MavlinkVersion,
10194 __input: &[u8],
10195 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10196 let avail_len = __input.len();
10197 let mut payload_buf = [0; Self::ENCODED_LEN];
10198 let mut buf = if avail_len < Self::ENCODED_LEN {
10199 payload_buf[0..avail_len].copy_from_slice(__input);
10200 Bytes::new(&payload_buf)
10201 } else {
10202 Bytes::new(__input)
10203 };
10204 let mut __struct = Self::default();
10205 __struct.time_boot_ms = buf.get_u32_le();
10206 __struct.min_distance = buf.get_u16_le();
10207 __struct.max_distance = buf.get_u16_le();
10208 __struct.current_distance = buf.get_u16_le();
10209 let tmp = buf.get_u8();
10210 __struct.mavtype =
10211 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10212 enum_type: "MavDistanceSensor",
10213 value: tmp as u32,
10214 })?;
10215 __struct.id = buf.get_u8();
10216 let tmp = buf.get_u8();
10217 __struct.orientation =
10218 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10219 enum_type: "MavSensorOrientation",
10220 value: tmp as u32,
10221 })?;
10222 __struct.covariance = buf.get_u8();
10223 __struct.horizontal_fov = buf.get_f32_le();
10224 __struct.vertical_fov = buf.get_f32_le();
10225 for v in &mut __struct.quaternion {
10226 let val = buf.get_f32_le();
10227 *v = val;
10228 }
10229 __struct.signal_quality = buf.get_u8();
10230 Ok(__struct)
10231 }
10232 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10233 let mut __tmp = BytesMut::new(bytes);
10234 #[allow(clippy::absurd_extreme_comparisons)]
10235 #[allow(unused_comparisons)]
10236 if __tmp.remaining() < Self::ENCODED_LEN {
10237 panic!(
10238 "buffer is too small (need {} bytes, but got {})",
10239 Self::ENCODED_LEN,
10240 __tmp.remaining(),
10241 )
10242 }
10243 __tmp.put_u32_le(self.time_boot_ms);
10244 __tmp.put_u16_le(self.min_distance);
10245 __tmp.put_u16_le(self.max_distance);
10246 __tmp.put_u16_le(self.current_distance);
10247 __tmp.put_u8(self.mavtype as u8);
10248 __tmp.put_u8(self.id);
10249 __tmp.put_u8(self.orientation as u8);
10250 __tmp.put_u8(self.covariance);
10251 __tmp.put_f32_le(self.horizontal_fov);
10252 __tmp.put_f32_le(self.vertical_fov);
10253 for val in &self.quaternion {
10254 __tmp.put_f32_le(*val);
10255 }
10256 __tmp.put_u8(self.signal_quality);
10257 if matches!(version, MavlinkVersion::V2) {
10258 let len = __tmp.len();
10259 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10260 } else {
10261 __tmp.len()
10262 }
10263 }
10264}
10265#[doc = "id: 225"]
10266#[doc = "EFI status output."]
10267#[derive(Debug, Clone, PartialEq)]
10268#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10269#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10270pub struct EFI_STATUS_DATA {
10271 #[doc = "ECU index"]
10272 pub ecu_index: f32,
10273 #[doc = "RPM"]
10274 pub rpm: f32,
10275 #[doc = "Fuel consumed"]
10276 pub fuel_consumed: f32,
10277 #[doc = "Fuel flow rate"]
10278 pub fuel_flow: f32,
10279 #[doc = "Engine load"]
10280 pub engine_load: f32,
10281 #[doc = "Throttle position"]
10282 pub throttle_position: f32,
10283 #[doc = "Spark dwell time"]
10284 pub spark_dwell_time: f32,
10285 #[doc = "Barometric pressure"]
10286 pub barometric_pressure: f32,
10287 #[doc = "Intake manifold pressure("]
10288 pub intake_manifold_pressure: f32,
10289 #[doc = "Intake manifold temperature"]
10290 pub intake_manifold_temperature: f32,
10291 #[doc = "Cylinder head temperature"]
10292 pub cylinder_head_temperature: f32,
10293 #[doc = "Ignition timing (Crank angle degrees)"]
10294 pub ignition_timing: f32,
10295 #[doc = "Injection time"]
10296 pub injection_time: f32,
10297 #[doc = "Exhaust gas temperature"]
10298 pub exhaust_gas_temperature: f32,
10299 #[doc = "Output throttle"]
10300 pub throttle_out: f32,
10301 #[doc = "Pressure/temperature compensation"]
10302 pub pt_compensation: f32,
10303 #[doc = "EFI health status"]
10304 pub health: u8,
10305 #[doc = "Supply voltage to EFI sparking system. Zero in this value means \"unknown\", so if the supply voltage really is zero volts use 0.0001 instead."]
10306 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10307 pub ignition_voltage: f32,
10308 #[doc = "Fuel pressure. Zero in this value means \"unknown\", so if the fuel pressure really is zero kPa use 0.0001 instead."]
10309 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10310 pub fuel_pressure: f32,
10311}
10312impl EFI_STATUS_DATA {
10313 pub const ENCODED_LEN: usize = 73usize;
10314 pub const DEFAULT: Self = Self {
10315 ecu_index: 0.0_f32,
10316 rpm: 0.0_f32,
10317 fuel_consumed: 0.0_f32,
10318 fuel_flow: 0.0_f32,
10319 engine_load: 0.0_f32,
10320 throttle_position: 0.0_f32,
10321 spark_dwell_time: 0.0_f32,
10322 barometric_pressure: 0.0_f32,
10323 intake_manifold_pressure: 0.0_f32,
10324 intake_manifold_temperature: 0.0_f32,
10325 cylinder_head_temperature: 0.0_f32,
10326 ignition_timing: 0.0_f32,
10327 injection_time: 0.0_f32,
10328 exhaust_gas_temperature: 0.0_f32,
10329 throttle_out: 0.0_f32,
10330 pt_compensation: 0.0_f32,
10331 health: 0_u8,
10332 ignition_voltage: 0.0_f32,
10333 fuel_pressure: 0.0_f32,
10334 };
10335 #[cfg(feature = "arbitrary")]
10336 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10337 use arbitrary::{Arbitrary, Unstructured};
10338 let mut buf = [0u8; 1024];
10339 rng.fill_bytes(&mut buf);
10340 let mut unstructured = Unstructured::new(&buf);
10341 Self::arbitrary(&mut unstructured).unwrap_or_default()
10342 }
10343}
10344impl Default for EFI_STATUS_DATA {
10345 fn default() -> Self {
10346 Self::DEFAULT.clone()
10347 }
10348}
10349impl MessageData for EFI_STATUS_DATA {
10350 type Message = MavMessage;
10351 const ID: u32 = 225u32;
10352 const NAME: &'static str = "EFI_STATUS";
10353 const EXTRA_CRC: u8 = 208u8;
10354 const ENCODED_LEN: usize = 73usize;
10355 fn deser(
10356 _version: MavlinkVersion,
10357 __input: &[u8],
10358 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10359 let avail_len = __input.len();
10360 let mut payload_buf = [0; Self::ENCODED_LEN];
10361 let mut buf = if avail_len < Self::ENCODED_LEN {
10362 payload_buf[0..avail_len].copy_from_slice(__input);
10363 Bytes::new(&payload_buf)
10364 } else {
10365 Bytes::new(__input)
10366 };
10367 let mut __struct = Self::default();
10368 __struct.ecu_index = buf.get_f32_le();
10369 __struct.rpm = buf.get_f32_le();
10370 __struct.fuel_consumed = buf.get_f32_le();
10371 __struct.fuel_flow = buf.get_f32_le();
10372 __struct.engine_load = buf.get_f32_le();
10373 __struct.throttle_position = buf.get_f32_le();
10374 __struct.spark_dwell_time = buf.get_f32_le();
10375 __struct.barometric_pressure = buf.get_f32_le();
10376 __struct.intake_manifold_pressure = buf.get_f32_le();
10377 __struct.intake_manifold_temperature = buf.get_f32_le();
10378 __struct.cylinder_head_temperature = buf.get_f32_le();
10379 __struct.ignition_timing = buf.get_f32_le();
10380 __struct.injection_time = buf.get_f32_le();
10381 __struct.exhaust_gas_temperature = buf.get_f32_le();
10382 __struct.throttle_out = buf.get_f32_le();
10383 __struct.pt_compensation = buf.get_f32_le();
10384 __struct.health = buf.get_u8();
10385 __struct.ignition_voltage = buf.get_f32_le();
10386 __struct.fuel_pressure = buf.get_f32_le();
10387 Ok(__struct)
10388 }
10389 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10390 let mut __tmp = BytesMut::new(bytes);
10391 #[allow(clippy::absurd_extreme_comparisons)]
10392 #[allow(unused_comparisons)]
10393 if __tmp.remaining() < Self::ENCODED_LEN {
10394 panic!(
10395 "buffer is too small (need {} bytes, but got {})",
10396 Self::ENCODED_LEN,
10397 __tmp.remaining(),
10398 )
10399 }
10400 __tmp.put_f32_le(self.ecu_index);
10401 __tmp.put_f32_le(self.rpm);
10402 __tmp.put_f32_le(self.fuel_consumed);
10403 __tmp.put_f32_le(self.fuel_flow);
10404 __tmp.put_f32_le(self.engine_load);
10405 __tmp.put_f32_le(self.throttle_position);
10406 __tmp.put_f32_le(self.spark_dwell_time);
10407 __tmp.put_f32_le(self.barometric_pressure);
10408 __tmp.put_f32_le(self.intake_manifold_pressure);
10409 __tmp.put_f32_le(self.intake_manifold_temperature);
10410 __tmp.put_f32_le(self.cylinder_head_temperature);
10411 __tmp.put_f32_le(self.ignition_timing);
10412 __tmp.put_f32_le(self.injection_time);
10413 __tmp.put_f32_le(self.exhaust_gas_temperature);
10414 __tmp.put_f32_le(self.throttle_out);
10415 __tmp.put_f32_le(self.pt_compensation);
10416 __tmp.put_u8(self.health);
10417 __tmp.put_f32_le(self.ignition_voltage);
10418 __tmp.put_f32_le(self.fuel_pressure);
10419 if matches!(version, MavlinkVersion::V2) {
10420 let len = __tmp.len();
10421 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10422 } else {
10423 __tmp.len()
10424 }
10425 }
10426}
10427#[doc = "id: 131"]
10428#[doc = "Data packet for images sent using the Image Transmission Protocol: <https://mavlink.io/en/services/image_transmission.html>."]
10429#[derive(Debug, Clone, PartialEq)]
10430#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10431#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10432pub struct ENCAPSULATED_DATA_DATA {
10433 #[doc = "sequence number (starting with 0 on every transmission)"]
10434 pub seqnr: u16,
10435 #[doc = "image data bytes"]
10436 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10437 pub data: [u8; 253],
10438}
10439impl ENCAPSULATED_DATA_DATA {
10440 pub const ENCODED_LEN: usize = 255usize;
10441 pub const DEFAULT: Self = Self {
10442 seqnr: 0_u16,
10443 data: [0_u8; 253usize],
10444 };
10445 #[cfg(feature = "arbitrary")]
10446 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10447 use arbitrary::{Arbitrary, Unstructured};
10448 let mut buf = [0u8; 1024];
10449 rng.fill_bytes(&mut buf);
10450 let mut unstructured = Unstructured::new(&buf);
10451 Self::arbitrary(&mut unstructured).unwrap_or_default()
10452 }
10453}
10454impl Default for ENCAPSULATED_DATA_DATA {
10455 fn default() -> Self {
10456 Self::DEFAULT.clone()
10457 }
10458}
10459impl MessageData for ENCAPSULATED_DATA_DATA {
10460 type Message = MavMessage;
10461 const ID: u32 = 131u32;
10462 const NAME: &'static str = "ENCAPSULATED_DATA";
10463 const EXTRA_CRC: u8 = 223u8;
10464 const ENCODED_LEN: usize = 255usize;
10465 fn deser(
10466 _version: MavlinkVersion,
10467 __input: &[u8],
10468 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10469 let avail_len = __input.len();
10470 let mut payload_buf = [0; Self::ENCODED_LEN];
10471 let mut buf = if avail_len < Self::ENCODED_LEN {
10472 payload_buf[0..avail_len].copy_from_slice(__input);
10473 Bytes::new(&payload_buf)
10474 } else {
10475 Bytes::new(__input)
10476 };
10477 let mut __struct = Self::default();
10478 __struct.seqnr = buf.get_u16_le();
10479 for v in &mut __struct.data {
10480 let val = buf.get_u8();
10481 *v = val;
10482 }
10483 Ok(__struct)
10484 }
10485 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10486 let mut __tmp = BytesMut::new(bytes);
10487 #[allow(clippy::absurd_extreme_comparisons)]
10488 #[allow(unused_comparisons)]
10489 if __tmp.remaining() < Self::ENCODED_LEN {
10490 panic!(
10491 "buffer is too small (need {} bytes, but got {})",
10492 Self::ENCODED_LEN,
10493 __tmp.remaining(),
10494 )
10495 }
10496 __tmp.put_u16_le(self.seqnr);
10497 for val in &self.data {
10498 __tmp.put_u8(*val);
10499 }
10500 if matches!(version, MavlinkVersion::V2) {
10501 let len = __tmp.len();
10502 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10503 } else {
10504 __tmp.len()
10505 }
10506 }
10507}
10508#[doc = "id: 290"]
10509#[doc = "ESC information for lower rate streaming. Recommended streaming rate 1Hz. See ESC_STATUS for higher-rate ESC data."]
10510#[derive(Debug, Clone, PartialEq)]
10511#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10512#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10513pub struct ESC_INFO_DATA {
10514 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number."]
10515 pub time_usec: u64,
10516 #[doc = "Number of reported errors by each ESC since boot."]
10517 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10518 pub error_count: [u32; 4],
10519 #[doc = "Counter of data packets received."]
10520 pub counter: u16,
10521 #[doc = "Bitmap of ESC failure flags."]
10522 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10523 pub failure_flags: [u16; 4],
10524 #[doc = "Temperature of each ESC. INT16_MAX: if data not supplied by ESC."]
10525 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10526 pub temperature: [i16; 4],
10527 #[doc = "Index of the first ESC in this message. minValue = 0, maxValue = 60, increment = 4."]
10528 pub index: u8,
10529 #[doc = "Total number of ESCs in all messages of this type. Message fields with an index higher than this should be ignored because they contain invalid data."]
10530 pub count: u8,
10531 #[doc = "Connection type protocol for all ESC."]
10532 pub connection_type: EscConnectionType,
10533 #[doc = "Information regarding online/offline status of each ESC."]
10534 pub info: u8,
10535}
10536impl ESC_INFO_DATA {
10537 pub const ENCODED_LEN: usize = 46usize;
10538 pub const DEFAULT: Self = Self {
10539 time_usec: 0_u64,
10540 error_count: [0_u32; 4usize],
10541 counter: 0_u16,
10542 failure_flags: [0_u16; 4usize],
10543 temperature: [0_i16; 4usize],
10544 index: 0_u8,
10545 count: 0_u8,
10546 connection_type: EscConnectionType::DEFAULT,
10547 info: 0_u8,
10548 };
10549 #[cfg(feature = "arbitrary")]
10550 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10551 use arbitrary::{Arbitrary, Unstructured};
10552 let mut buf = [0u8; 1024];
10553 rng.fill_bytes(&mut buf);
10554 let mut unstructured = Unstructured::new(&buf);
10555 Self::arbitrary(&mut unstructured).unwrap_or_default()
10556 }
10557}
10558impl Default for ESC_INFO_DATA {
10559 fn default() -> Self {
10560 Self::DEFAULT.clone()
10561 }
10562}
10563impl MessageData for ESC_INFO_DATA {
10564 type Message = MavMessage;
10565 const ID: u32 = 290u32;
10566 const NAME: &'static str = "ESC_INFO";
10567 const EXTRA_CRC: u8 = 251u8;
10568 const ENCODED_LEN: usize = 46usize;
10569 fn deser(
10570 _version: MavlinkVersion,
10571 __input: &[u8],
10572 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10573 let avail_len = __input.len();
10574 let mut payload_buf = [0; Self::ENCODED_LEN];
10575 let mut buf = if avail_len < Self::ENCODED_LEN {
10576 payload_buf[0..avail_len].copy_from_slice(__input);
10577 Bytes::new(&payload_buf)
10578 } else {
10579 Bytes::new(__input)
10580 };
10581 let mut __struct = Self::default();
10582 __struct.time_usec = buf.get_u64_le();
10583 for v in &mut __struct.error_count {
10584 let val = buf.get_u32_le();
10585 *v = val;
10586 }
10587 __struct.counter = buf.get_u16_le();
10588 for v in &mut __struct.failure_flags {
10589 let val = buf.get_u16_le();
10590 *v = val;
10591 }
10592 for v in &mut __struct.temperature {
10593 let val = buf.get_i16_le();
10594 *v = val;
10595 }
10596 __struct.index = buf.get_u8();
10597 __struct.count = buf.get_u8();
10598 let tmp = buf.get_u8();
10599 __struct.connection_type =
10600 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10601 enum_type: "EscConnectionType",
10602 value: tmp as u32,
10603 })?;
10604 __struct.info = buf.get_u8();
10605 Ok(__struct)
10606 }
10607 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10608 let mut __tmp = BytesMut::new(bytes);
10609 #[allow(clippy::absurd_extreme_comparisons)]
10610 #[allow(unused_comparisons)]
10611 if __tmp.remaining() < Self::ENCODED_LEN {
10612 panic!(
10613 "buffer is too small (need {} bytes, but got {})",
10614 Self::ENCODED_LEN,
10615 __tmp.remaining(),
10616 )
10617 }
10618 __tmp.put_u64_le(self.time_usec);
10619 for val in &self.error_count {
10620 __tmp.put_u32_le(*val);
10621 }
10622 __tmp.put_u16_le(self.counter);
10623 for val in &self.failure_flags {
10624 __tmp.put_u16_le(*val);
10625 }
10626 for val in &self.temperature {
10627 __tmp.put_i16_le(*val);
10628 }
10629 __tmp.put_u8(self.index);
10630 __tmp.put_u8(self.count);
10631 __tmp.put_u8(self.connection_type as u8);
10632 __tmp.put_u8(self.info);
10633 if matches!(version, MavlinkVersion::V2) {
10634 let len = __tmp.len();
10635 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10636 } else {
10637 __tmp.len()
10638 }
10639 }
10640}
10641#[doc = "id: 291"]
10642#[doc = "ESC information for higher rate streaming. Recommended streaming rate is ~10 Hz. Information that changes more slowly is sent in ESC_INFO. It should typically only be streamed on high-bandwidth links (i.e. to a companion computer)."]
10643#[derive(Debug, Clone, PartialEq)]
10644#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10645#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10646pub struct ESC_STATUS_DATA {
10647 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number."]
10648 pub time_usec: u64,
10649 #[doc = "Reported motor RPM from each ESC (negative for reverse rotation)."]
10650 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10651 pub rpm: [i32; 4],
10652 #[doc = "Voltage measured from each ESC."]
10653 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10654 pub voltage: [f32; 4],
10655 #[doc = "Current measured from each ESC."]
10656 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10657 pub current: [f32; 4],
10658 #[doc = "Index of the first ESC in this message. minValue = 0, maxValue = 60, increment = 4."]
10659 pub index: u8,
10660}
10661impl ESC_STATUS_DATA {
10662 pub const ENCODED_LEN: usize = 57usize;
10663 pub const DEFAULT: Self = Self {
10664 time_usec: 0_u64,
10665 rpm: [0_i32; 4usize],
10666 voltage: [0.0_f32; 4usize],
10667 current: [0.0_f32; 4usize],
10668 index: 0_u8,
10669 };
10670 #[cfg(feature = "arbitrary")]
10671 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10672 use arbitrary::{Arbitrary, Unstructured};
10673 let mut buf = [0u8; 1024];
10674 rng.fill_bytes(&mut buf);
10675 let mut unstructured = Unstructured::new(&buf);
10676 Self::arbitrary(&mut unstructured).unwrap_or_default()
10677 }
10678}
10679impl Default for ESC_STATUS_DATA {
10680 fn default() -> Self {
10681 Self::DEFAULT.clone()
10682 }
10683}
10684impl MessageData for ESC_STATUS_DATA {
10685 type Message = MavMessage;
10686 const ID: u32 = 291u32;
10687 const NAME: &'static str = "ESC_STATUS";
10688 const EXTRA_CRC: u8 = 10u8;
10689 const ENCODED_LEN: usize = 57usize;
10690 fn deser(
10691 _version: MavlinkVersion,
10692 __input: &[u8],
10693 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10694 let avail_len = __input.len();
10695 let mut payload_buf = [0; Self::ENCODED_LEN];
10696 let mut buf = if avail_len < Self::ENCODED_LEN {
10697 payload_buf[0..avail_len].copy_from_slice(__input);
10698 Bytes::new(&payload_buf)
10699 } else {
10700 Bytes::new(__input)
10701 };
10702 let mut __struct = Self::default();
10703 __struct.time_usec = buf.get_u64_le();
10704 for v in &mut __struct.rpm {
10705 let val = buf.get_i32_le();
10706 *v = val;
10707 }
10708 for v in &mut __struct.voltage {
10709 let val = buf.get_f32_le();
10710 *v = val;
10711 }
10712 for v in &mut __struct.current {
10713 let val = buf.get_f32_le();
10714 *v = val;
10715 }
10716 __struct.index = buf.get_u8();
10717 Ok(__struct)
10718 }
10719 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10720 let mut __tmp = BytesMut::new(bytes);
10721 #[allow(clippy::absurd_extreme_comparisons)]
10722 #[allow(unused_comparisons)]
10723 if __tmp.remaining() < Self::ENCODED_LEN {
10724 panic!(
10725 "buffer is too small (need {} bytes, but got {})",
10726 Self::ENCODED_LEN,
10727 __tmp.remaining(),
10728 )
10729 }
10730 __tmp.put_u64_le(self.time_usec);
10731 for val in &self.rpm {
10732 __tmp.put_i32_le(*val);
10733 }
10734 for val in &self.voltage {
10735 __tmp.put_f32_le(*val);
10736 }
10737 for val in &self.current {
10738 __tmp.put_f32_le(*val);
10739 }
10740 __tmp.put_u8(self.index);
10741 if matches!(version, MavlinkVersion::V2) {
10742 let len = __tmp.len();
10743 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10744 } else {
10745 __tmp.len()
10746 }
10747 }
10748}
10749#[doc = "id: 230"]
10750#[doc = "Estimator status message including flags, innovation test ratios and estimated accuracies. The flags message is an integer bitmask containing information on which EKF outputs are valid. See the ESTIMATOR_STATUS_FLAGS enum definition for further information. The innovation test ratios show the magnitude of the sensor innovation divided by the innovation check threshold. Under normal operation the innovation test ratios should be below 0.5 with occasional values up to 1.0. Values greater than 1.0 should be rare under normal operation and indicate that a measurement has been rejected by the filter. The user should be notified if an innovation test ratio greater than 1.0 is recorded. Notifications for values in the range between 0.5 and 1.0 should be optional and controllable by the user."]
10751#[derive(Debug, Clone, PartialEq)]
10752#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10753#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10754pub struct ESTIMATOR_STATUS_DATA {
10755 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
10756 pub time_usec: u64,
10757 #[doc = "Velocity innovation test ratio"]
10758 pub vel_ratio: f32,
10759 #[doc = "Horizontal position innovation test ratio"]
10760 pub pos_horiz_ratio: f32,
10761 #[doc = "Vertical position innovation test ratio"]
10762 pub pos_vert_ratio: f32,
10763 #[doc = "Magnetometer innovation test ratio"]
10764 pub mag_ratio: f32,
10765 #[doc = "Height above terrain innovation test ratio"]
10766 pub hagl_ratio: f32,
10767 #[doc = "True airspeed innovation test ratio"]
10768 pub tas_ratio: f32,
10769 #[doc = "Horizontal position 1-STD accuracy relative to the EKF local origin"]
10770 pub pos_horiz_accuracy: f32,
10771 #[doc = "Vertical position 1-STD accuracy relative to the EKF local origin"]
10772 pub pos_vert_accuracy: f32,
10773 #[doc = "Bitmap indicating which EKF outputs are valid."]
10774 pub flags: EstimatorStatusFlags,
10775}
10776impl ESTIMATOR_STATUS_DATA {
10777 pub const ENCODED_LEN: usize = 42usize;
10778 pub const DEFAULT: Self = Self {
10779 time_usec: 0_u64,
10780 vel_ratio: 0.0_f32,
10781 pos_horiz_ratio: 0.0_f32,
10782 pos_vert_ratio: 0.0_f32,
10783 mag_ratio: 0.0_f32,
10784 hagl_ratio: 0.0_f32,
10785 tas_ratio: 0.0_f32,
10786 pos_horiz_accuracy: 0.0_f32,
10787 pos_vert_accuracy: 0.0_f32,
10788 flags: EstimatorStatusFlags::DEFAULT,
10789 };
10790 #[cfg(feature = "arbitrary")]
10791 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10792 use arbitrary::{Arbitrary, Unstructured};
10793 let mut buf = [0u8; 1024];
10794 rng.fill_bytes(&mut buf);
10795 let mut unstructured = Unstructured::new(&buf);
10796 Self::arbitrary(&mut unstructured).unwrap_or_default()
10797 }
10798}
10799impl Default for ESTIMATOR_STATUS_DATA {
10800 fn default() -> Self {
10801 Self::DEFAULT.clone()
10802 }
10803}
10804impl MessageData for ESTIMATOR_STATUS_DATA {
10805 type Message = MavMessage;
10806 const ID: u32 = 230u32;
10807 const NAME: &'static str = "ESTIMATOR_STATUS";
10808 const EXTRA_CRC: u8 = 163u8;
10809 const ENCODED_LEN: usize = 42usize;
10810 fn deser(
10811 _version: MavlinkVersion,
10812 __input: &[u8],
10813 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10814 let avail_len = __input.len();
10815 let mut payload_buf = [0; Self::ENCODED_LEN];
10816 let mut buf = if avail_len < Self::ENCODED_LEN {
10817 payload_buf[0..avail_len].copy_from_slice(__input);
10818 Bytes::new(&payload_buf)
10819 } else {
10820 Bytes::new(__input)
10821 };
10822 let mut __struct = Self::default();
10823 __struct.time_usec = buf.get_u64_le();
10824 __struct.vel_ratio = buf.get_f32_le();
10825 __struct.pos_horiz_ratio = buf.get_f32_le();
10826 __struct.pos_vert_ratio = buf.get_f32_le();
10827 __struct.mag_ratio = buf.get_f32_le();
10828 __struct.hagl_ratio = buf.get_f32_le();
10829 __struct.tas_ratio = buf.get_f32_le();
10830 __struct.pos_horiz_accuracy = buf.get_f32_le();
10831 __struct.pos_vert_accuracy = buf.get_f32_le();
10832 let tmp = buf.get_u16_le();
10833 __struct.flags = EstimatorStatusFlags::from_bits(tmp & EstimatorStatusFlags::all().bits())
10834 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
10835 flag_type: "EstimatorStatusFlags",
10836 value: tmp as u32,
10837 })?;
10838 Ok(__struct)
10839 }
10840 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10841 let mut __tmp = BytesMut::new(bytes);
10842 #[allow(clippy::absurd_extreme_comparisons)]
10843 #[allow(unused_comparisons)]
10844 if __tmp.remaining() < Self::ENCODED_LEN {
10845 panic!(
10846 "buffer is too small (need {} bytes, but got {})",
10847 Self::ENCODED_LEN,
10848 __tmp.remaining(),
10849 )
10850 }
10851 __tmp.put_u64_le(self.time_usec);
10852 __tmp.put_f32_le(self.vel_ratio);
10853 __tmp.put_f32_le(self.pos_horiz_ratio);
10854 __tmp.put_f32_le(self.pos_vert_ratio);
10855 __tmp.put_f32_le(self.mag_ratio);
10856 __tmp.put_f32_le(self.hagl_ratio);
10857 __tmp.put_f32_le(self.tas_ratio);
10858 __tmp.put_f32_le(self.pos_horiz_accuracy);
10859 __tmp.put_f32_le(self.pos_vert_accuracy);
10860 __tmp.put_u16_le(self.flags.bits());
10861 if matches!(version, MavlinkVersion::V2) {
10862 let len = __tmp.len();
10863 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10864 } else {
10865 __tmp.len()
10866 }
10867 }
10868}
10869#[doc = "id: 410"]
10870#[doc = "Event message. Each new event from a particular component gets a new sequence number. The same message might be sent multiple times if (re-)requested. Most events are broadcast, some can be specific to a target component (as receivers keep track of the sequence for missed events, all events need to be broadcast. Thus we use destination_component instead of target_component)."]
10871#[derive(Debug, Clone, PartialEq)]
10872#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10873#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10874pub struct EVENT_DATA {
10875 #[doc = "Event ID (as defined in the component metadata)"]
10876 pub id: u32,
10877 #[doc = "Timestamp (time since system boot when the event happened)."]
10878 pub event_time_boot_ms: u32,
10879 #[doc = "Sequence number."]
10880 pub sequence: u16,
10881 #[doc = "Component ID"]
10882 pub destination_component: u8,
10883 #[doc = "System ID"]
10884 pub destination_system: u8,
10885 #[doc = "Log levels: 4 bits MSB: internal (for logging purposes), 4 bits LSB: external. Levels: Emergency = 0, Alert = 1, Critical = 2, Error = 3, Warning = 4, Notice = 5, Info = 6, Debug = 7, Protocol = 8, Disabled = 9"]
10886 pub log_levels: u8,
10887 #[doc = "Arguments (depend on event ID)."]
10888 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10889 pub arguments: [u8; 40],
10890}
10891impl EVENT_DATA {
10892 pub const ENCODED_LEN: usize = 53usize;
10893 pub const DEFAULT: Self = Self {
10894 id: 0_u32,
10895 event_time_boot_ms: 0_u32,
10896 sequence: 0_u16,
10897 destination_component: 0_u8,
10898 destination_system: 0_u8,
10899 log_levels: 0_u8,
10900 arguments: [0_u8; 40usize],
10901 };
10902 #[cfg(feature = "arbitrary")]
10903 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10904 use arbitrary::{Arbitrary, Unstructured};
10905 let mut buf = [0u8; 1024];
10906 rng.fill_bytes(&mut buf);
10907 let mut unstructured = Unstructured::new(&buf);
10908 Self::arbitrary(&mut unstructured).unwrap_or_default()
10909 }
10910}
10911impl Default for EVENT_DATA {
10912 fn default() -> Self {
10913 Self::DEFAULT.clone()
10914 }
10915}
10916impl MessageData for EVENT_DATA {
10917 type Message = MavMessage;
10918 const ID: u32 = 410u32;
10919 const NAME: &'static str = "EVENT";
10920 const EXTRA_CRC: u8 = 160u8;
10921 const ENCODED_LEN: usize = 53usize;
10922 fn deser(
10923 _version: MavlinkVersion,
10924 __input: &[u8],
10925 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10926 let avail_len = __input.len();
10927 let mut payload_buf = [0; Self::ENCODED_LEN];
10928 let mut buf = if avail_len < Self::ENCODED_LEN {
10929 payload_buf[0..avail_len].copy_from_slice(__input);
10930 Bytes::new(&payload_buf)
10931 } else {
10932 Bytes::new(__input)
10933 };
10934 let mut __struct = Self::default();
10935 __struct.id = buf.get_u32_le();
10936 __struct.event_time_boot_ms = buf.get_u32_le();
10937 __struct.sequence = buf.get_u16_le();
10938 __struct.destination_component = buf.get_u8();
10939 __struct.destination_system = buf.get_u8();
10940 __struct.log_levels = buf.get_u8();
10941 for v in &mut __struct.arguments {
10942 let val = buf.get_u8();
10943 *v = val;
10944 }
10945 Ok(__struct)
10946 }
10947 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10948 let mut __tmp = BytesMut::new(bytes);
10949 #[allow(clippy::absurd_extreme_comparisons)]
10950 #[allow(unused_comparisons)]
10951 if __tmp.remaining() < Self::ENCODED_LEN {
10952 panic!(
10953 "buffer is too small (need {} bytes, but got {})",
10954 Self::ENCODED_LEN,
10955 __tmp.remaining(),
10956 )
10957 }
10958 __tmp.put_u32_le(self.id);
10959 __tmp.put_u32_le(self.event_time_boot_ms);
10960 __tmp.put_u16_le(self.sequence);
10961 __tmp.put_u8(self.destination_component);
10962 __tmp.put_u8(self.destination_system);
10963 __tmp.put_u8(self.log_levels);
10964 for val in &self.arguments {
10965 __tmp.put_u8(*val);
10966 }
10967 if matches!(version, MavlinkVersion::V2) {
10968 let len = __tmp.len();
10969 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10970 } else {
10971 __tmp.len()
10972 }
10973 }
10974}
10975#[doc = "id: 245"]
10976#[doc = "Provides state for additional features."]
10977#[derive(Debug, Clone, PartialEq)]
10978#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10979#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10980pub struct EXTENDED_SYS_STATE_DATA {
10981 #[doc = "The VTOL state if applicable. Is set to MAV_VTOL_STATE_UNDEFINED if UAV is not in VTOL configuration."]
10982 pub vtol_state: MavVtolState,
10983 #[doc = "The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown."]
10984 pub landed_state: MavLandedState,
10985}
10986impl EXTENDED_SYS_STATE_DATA {
10987 pub const ENCODED_LEN: usize = 2usize;
10988 pub const DEFAULT: Self = Self {
10989 vtol_state: MavVtolState::DEFAULT,
10990 landed_state: MavLandedState::DEFAULT,
10991 };
10992 #[cfg(feature = "arbitrary")]
10993 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10994 use arbitrary::{Arbitrary, Unstructured};
10995 let mut buf = [0u8; 1024];
10996 rng.fill_bytes(&mut buf);
10997 let mut unstructured = Unstructured::new(&buf);
10998 Self::arbitrary(&mut unstructured).unwrap_or_default()
10999 }
11000}
11001impl Default for EXTENDED_SYS_STATE_DATA {
11002 fn default() -> Self {
11003 Self::DEFAULT.clone()
11004 }
11005}
11006impl MessageData for EXTENDED_SYS_STATE_DATA {
11007 type Message = MavMessage;
11008 const ID: u32 = 245u32;
11009 const NAME: &'static str = "EXTENDED_SYS_STATE";
11010 const EXTRA_CRC: u8 = 130u8;
11011 const ENCODED_LEN: usize = 2usize;
11012 fn deser(
11013 _version: MavlinkVersion,
11014 __input: &[u8],
11015 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11016 let avail_len = __input.len();
11017 let mut payload_buf = [0; Self::ENCODED_LEN];
11018 let mut buf = if avail_len < Self::ENCODED_LEN {
11019 payload_buf[0..avail_len].copy_from_slice(__input);
11020 Bytes::new(&payload_buf)
11021 } else {
11022 Bytes::new(__input)
11023 };
11024 let mut __struct = Self::default();
11025 let tmp = buf.get_u8();
11026 __struct.vtol_state =
11027 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11028 enum_type: "MavVtolState",
11029 value: tmp as u32,
11030 })?;
11031 let tmp = buf.get_u8();
11032 __struct.landed_state =
11033 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11034 enum_type: "MavLandedState",
11035 value: tmp as u32,
11036 })?;
11037 Ok(__struct)
11038 }
11039 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11040 let mut __tmp = BytesMut::new(bytes);
11041 #[allow(clippy::absurd_extreme_comparisons)]
11042 #[allow(unused_comparisons)]
11043 if __tmp.remaining() < Self::ENCODED_LEN {
11044 panic!(
11045 "buffer is too small (need {} bytes, but got {})",
11046 Self::ENCODED_LEN,
11047 __tmp.remaining(),
11048 )
11049 }
11050 __tmp.put_u8(self.vtol_state as u8);
11051 __tmp.put_u8(self.landed_state as u8);
11052 if matches!(version, MavlinkVersion::V2) {
11053 let len = __tmp.len();
11054 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11055 } else {
11056 __tmp.len()
11057 }
11058 }
11059}
11060#[doc = "id: 162"]
11061#[doc = "Status of geo-fencing. Sent in extended status stream when fencing enabled."]
11062#[derive(Debug, Clone, PartialEq)]
11063#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11064#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11065pub struct FENCE_STATUS_DATA {
11066 #[doc = "Time (since boot) of last breach."]
11067 pub breach_time: u32,
11068 #[doc = "Number of fence breaches."]
11069 pub breach_count: u16,
11070 #[doc = "Breach status (0 if currently inside fence, 1 if outside)."]
11071 pub breach_status: u8,
11072 #[doc = "Last breach type."]
11073 pub breach_type: FenceBreach,
11074 #[doc = "Active action to prevent fence breach"]
11075 #[cfg_attr(feature = "serde", serde(default))]
11076 pub breach_mitigation: FenceMitigate,
11077}
11078impl FENCE_STATUS_DATA {
11079 pub const ENCODED_LEN: usize = 9usize;
11080 pub const DEFAULT: Self = Self {
11081 breach_time: 0_u32,
11082 breach_count: 0_u16,
11083 breach_status: 0_u8,
11084 breach_type: FenceBreach::DEFAULT,
11085 breach_mitigation: FenceMitigate::DEFAULT,
11086 };
11087 #[cfg(feature = "arbitrary")]
11088 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11089 use arbitrary::{Arbitrary, Unstructured};
11090 let mut buf = [0u8; 1024];
11091 rng.fill_bytes(&mut buf);
11092 let mut unstructured = Unstructured::new(&buf);
11093 Self::arbitrary(&mut unstructured).unwrap_or_default()
11094 }
11095}
11096impl Default for FENCE_STATUS_DATA {
11097 fn default() -> Self {
11098 Self::DEFAULT.clone()
11099 }
11100}
11101impl MessageData for FENCE_STATUS_DATA {
11102 type Message = MavMessage;
11103 const ID: u32 = 162u32;
11104 const NAME: &'static str = "FENCE_STATUS";
11105 const EXTRA_CRC: u8 = 189u8;
11106 const ENCODED_LEN: usize = 9usize;
11107 fn deser(
11108 _version: MavlinkVersion,
11109 __input: &[u8],
11110 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11111 let avail_len = __input.len();
11112 let mut payload_buf = [0; Self::ENCODED_LEN];
11113 let mut buf = if avail_len < Self::ENCODED_LEN {
11114 payload_buf[0..avail_len].copy_from_slice(__input);
11115 Bytes::new(&payload_buf)
11116 } else {
11117 Bytes::new(__input)
11118 };
11119 let mut __struct = Self::default();
11120 __struct.breach_time = buf.get_u32_le();
11121 __struct.breach_count = buf.get_u16_le();
11122 __struct.breach_status = buf.get_u8();
11123 let tmp = buf.get_u8();
11124 __struct.breach_type =
11125 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11126 enum_type: "FenceBreach",
11127 value: tmp as u32,
11128 })?;
11129 let tmp = buf.get_u8();
11130 __struct.breach_mitigation =
11131 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11132 enum_type: "FenceMitigate",
11133 value: tmp as u32,
11134 })?;
11135 Ok(__struct)
11136 }
11137 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11138 let mut __tmp = BytesMut::new(bytes);
11139 #[allow(clippy::absurd_extreme_comparisons)]
11140 #[allow(unused_comparisons)]
11141 if __tmp.remaining() < Self::ENCODED_LEN {
11142 panic!(
11143 "buffer is too small (need {} bytes, but got {})",
11144 Self::ENCODED_LEN,
11145 __tmp.remaining(),
11146 )
11147 }
11148 __tmp.put_u32_le(self.breach_time);
11149 __tmp.put_u16_le(self.breach_count);
11150 __tmp.put_u8(self.breach_status);
11151 __tmp.put_u8(self.breach_type as u8);
11152 __tmp.put_u8(self.breach_mitigation as u8);
11153 if matches!(version, MavlinkVersion::V2) {
11154 let len = __tmp.len();
11155 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11156 } else {
11157 __tmp.len()
11158 }
11159 }
11160}
11161#[doc = "id: 110"]
11162#[doc = "File transfer protocol message: <https://mavlink.io/en/services/ftp.html>."]
11163#[derive(Debug, Clone, PartialEq)]
11164#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11165#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11166pub struct FILE_TRANSFER_PROTOCOL_DATA {
11167 #[doc = "Network ID (0 for broadcast)"]
11168 pub target_network: u8,
11169 #[doc = "System ID (0 for broadcast)"]
11170 pub target_system: u8,
11171 #[doc = "Component ID (0 for broadcast)"]
11172 pub target_component: u8,
11173 #[doc = "Variable length payload. The length is defined by the remaining message length when subtracting the header and other fields. The content/format of this block is defined in <https://mavlink.io/en/services/ftp.html>."]
11174 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11175 pub payload: [u8; 251],
11176}
11177impl FILE_TRANSFER_PROTOCOL_DATA {
11178 pub const ENCODED_LEN: usize = 254usize;
11179 pub const DEFAULT: Self = Self {
11180 target_network: 0_u8,
11181 target_system: 0_u8,
11182 target_component: 0_u8,
11183 payload: [0_u8; 251usize],
11184 };
11185 #[cfg(feature = "arbitrary")]
11186 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11187 use arbitrary::{Arbitrary, Unstructured};
11188 let mut buf = [0u8; 1024];
11189 rng.fill_bytes(&mut buf);
11190 let mut unstructured = Unstructured::new(&buf);
11191 Self::arbitrary(&mut unstructured).unwrap_or_default()
11192 }
11193}
11194impl Default for FILE_TRANSFER_PROTOCOL_DATA {
11195 fn default() -> Self {
11196 Self::DEFAULT.clone()
11197 }
11198}
11199impl MessageData for FILE_TRANSFER_PROTOCOL_DATA {
11200 type Message = MavMessage;
11201 const ID: u32 = 110u32;
11202 const NAME: &'static str = "FILE_TRANSFER_PROTOCOL";
11203 const EXTRA_CRC: u8 = 84u8;
11204 const ENCODED_LEN: usize = 254usize;
11205 fn deser(
11206 _version: MavlinkVersion,
11207 __input: &[u8],
11208 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11209 let avail_len = __input.len();
11210 let mut payload_buf = [0; Self::ENCODED_LEN];
11211 let mut buf = if avail_len < Self::ENCODED_LEN {
11212 payload_buf[0..avail_len].copy_from_slice(__input);
11213 Bytes::new(&payload_buf)
11214 } else {
11215 Bytes::new(__input)
11216 };
11217 let mut __struct = Self::default();
11218 __struct.target_network = buf.get_u8();
11219 __struct.target_system = buf.get_u8();
11220 __struct.target_component = buf.get_u8();
11221 for v in &mut __struct.payload {
11222 let val = buf.get_u8();
11223 *v = val;
11224 }
11225 Ok(__struct)
11226 }
11227 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11228 let mut __tmp = BytesMut::new(bytes);
11229 #[allow(clippy::absurd_extreme_comparisons)]
11230 #[allow(unused_comparisons)]
11231 if __tmp.remaining() < Self::ENCODED_LEN {
11232 panic!(
11233 "buffer is too small (need {} bytes, but got {})",
11234 Self::ENCODED_LEN,
11235 __tmp.remaining(),
11236 )
11237 }
11238 __tmp.put_u8(self.target_network);
11239 __tmp.put_u8(self.target_system);
11240 __tmp.put_u8(self.target_component);
11241 for val in &self.payload {
11242 __tmp.put_u8(*val);
11243 }
11244 if matches!(version, MavlinkVersion::V2) {
11245 let len = __tmp.len();
11246 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11247 } else {
11248 __tmp.len()
11249 }
11250 }
11251}
11252#[doc = "id: 264"]
11253#[doc = "Flight information. This includes time since boot for arm, takeoff, and land, and a flight number. Takeoff and landing values reset to zero on arm. This can be requested using MAV_CMD_REQUEST_MESSAGE. Note, some fields are misnamed - timestamps are from boot (not UTC) and the flight_uuid is a sequence number."]
11254#[derive(Debug, Clone, PartialEq)]
11255#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11256#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11257pub struct FLIGHT_INFORMATION_DATA {
11258 #[doc = "Timestamp at arming (since system boot). Set to 0 on boot. Set value on arming. Note, field is misnamed UTC."]
11259 pub arming_time_utc: u64,
11260 #[doc = "Timestamp at takeoff (since system boot). Set to 0 at boot and on arming. Note, field is misnamed UTC."]
11261 pub takeoff_time_utc: u64,
11262 #[doc = "Flight number. Note, field is misnamed UUID."]
11263 pub flight_uuid: u64,
11264 #[doc = "Timestamp (time since system boot)."]
11265 pub time_boot_ms: u32,
11266 #[doc = "Timestamp at landing (in ms since system boot). Set to 0 at boot and on arming."]
11267 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
11268 pub landing_time: u32,
11269}
11270impl FLIGHT_INFORMATION_DATA {
11271 pub const ENCODED_LEN: usize = 32usize;
11272 pub const DEFAULT: Self = Self {
11273 arming_time_utc: 0_u64,
11274 takeoff_time_utc: 0_u64,
11275 flight_uuid: 0_u64,
11276 time_boot_ms: 0_u32,
11277 landing_time: 0_u32,
11278 };
11279 #[cfg(feature = "arbitrary")]
11280 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11281 use arbitrary::{Arbitrary, Unstructured};
11282 let mut buf = [0u8; 1024];
11283 rng.fill_bytes(&mut buf);
11284 let mut unstructured = Unstructured::new(&buf);
11285 Self::arbitrary(&mut unstructured).unwrap_or_default()
11286 }
11287}
11288impl Default for FLIGHT_INFORMATION_DATA {
11289 fn default() -> Self {
11290 Self::DEFAULT.clone()
11291 }
11292}
11293impl MessageData for FLIGHT_INFORMATION_DATA {
11294 type Message = MavMessage;
11295 const ID: u32 = 264u32;
11296 const NAME: &'static str = "FLIGHT_INFORMATION";
11297 const EXTRA_CRC: u8 = 49u8;
11298 const ENCODED_LEN: usize = 32usize;
11299 fn deser(
11300 _version: MavlinkVersion,
11301 __input: &[u8],
11302 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11303 let avail_len = __input.len();
11304 let mut payload_buf = [0; Self::ENCODED_LEN];
11305 let mut buf = if avail_len < Self::ENCODED_LEN {
11306 payload_buf[0..avail_len].copy_from_slice(__input);
11307 Bytes::new(&payload_buf)
11308 } else {
11309 Bytes::new(__input)
11310 };
11311 let mut __struct = Self::default();
11312 __struct.arming_time_utc = buf.get_u64_le();
11313 __struct.takeoff_time_utc = buf.get_u64_le();
11314 __struct.flight_uuid = buf.get_u64_le();
11315 __struct.time_boot_ms = buf.get_u32_le();
11316 __struct.landing_time = buf.get_u32_le();
11317 Ok(__struct)
11318 }
11319 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11320 let mut __tmp = BytesMut::new(bytes);
11321 #[allow(clippy::absurd_extreme_comparisons)]
11322 #[allow(unused_comparisons)]
11323 if __tmp.remaining() < Self::ENCODED_LEN {
11324 panic!(
11325 "buffer is too small (need {} bytes, but got {})",
11326 Self::ENCODED_LEN,
11327 __tmp.remaining(),
11328 )
11329 }
11330 __tmp.put_u64_le(self.arming_time_utc);
11331 __tmp.put_u64_le(self.takeoff_time_utc);
11332 __tmp.put_u64_le(self.flight_uuid);
11333 __tmp.put_u32_le(self.time_boot_ms);
11334 __tmp.put_u32_le(self.landing_time);
11335 if matches!(version, MavlinkVersion::V2) {
11336 let len = __tmp.len();
11337 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11338 } else {
11339 __tmp.len()
11340 }
11341 }
11342}
11343#[doc = "id: 144"]
11344#[doc = "Current motion information from a designated system."]
11345#[derive(Debug, Clone, PartialEq)]
11346#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11347#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11348pub struct FOLLOW_TARGET_DATA {
11349 #[doc = "Timestamp (time since system boot)."]
11350 pub timestamp: u64,
11351 #[doc = "button states or switches of a tracker device"]
11352 pub custom_state: u64,
11353 #[doc = "Latitude (WGS84)"]
11354 pub lat: i32,
11355 #[doc = "Longitude (WGS84)"]
11356 pub lon: i32,
11357 #[doc = "Altitude (MSL)"]
11358 pub alt: f32,
11359 #[doc = "target velocity (0,0,0) for unknown"]
11360 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11361 pub vel: [f32; 3],
11362 #[doc = "linear target acceleration (0,0,0) for unknown"]
11363 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11364 pub acc: [f32; 3],
11365 #[doc = "(0 0 0 0 for unknown)"]
11366 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11367 pub attitude_q: [f32; 4],
11368 #[doc = "(0 0 0 for unknown)"]
11369 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11370 pub rates: [f32; 3],
11371 #[doc = "eph epv"]
11372 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11373 pub position_cov: [f32; 3],
11374 #[doc = "bit positions for tracker reporting capabilities (POS = 0, VEL = 1, ACCEL = 2, ATT + RATES = 3)"]
11375 pub est_capabilities: u8,
11376}
11377impl FOLLOW_TARGET_DATA {
11378 pub const ENCODED_LEN: usize = 93usize;
11379 pub const DEFAULT: Self = Self {
11380 timestamp: 0_u64,
11381 custom_state: 0_u64,
11382 lat: 0_i32,
11383 lon: 0_i32,
11384 alt: 0.0_f32,
11385 vel: [0.0_f32; 3usize],
11386 acc: [0.0_f32; 3usize],
11387 attitude_q: [0.0_f32; 4usize],
11388 rates: [0.0_f32; 3usize],
11389 position_cov: [0.0_f32; 3usize],
11390 est_capabilities: 0_u8,
11391 };
11392 #[cfg(feature = "arbitrary")]
11393 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11394 use arbitrary::{Arbitrary, Unstructured};
11395 let mut buf = [0u8; 1024];
11396 rng.fill_bytes(&mut buf);
11397 let mut unstructured = Unstructured::new(&buf);
11398 Self::arbitrary(&mut unstructured).unwrap_or_default()
11399 }
11400}
11401impl Default for FOLLOW_TARGET_DATA {
11402 fn default() -> Self {
11403 Self::DEFAULT.clone()
11404 }
11405}
11406impl MessageData for FOLLOW_TARGET_DATA {
11407 type Message = MavMessage;
11408 const ID: u32 = 144u32;
11409 const NAME: &'static str = "FOLLOW_TARGET";
11410 const EXTRA_CRC: u8 = 127u8;
11411 const ENCODED_LEN: usize = 93usize;
11412 fn deser(
11413 _version: MavlinkVersion,
11414 __input: &[u8],
11415 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11416 let avail_len = __input.len();
11417 let mut payload_buf = [0; Self::ENCODED_LEN];
11418 let mut buf = if avail_len < Self::ENCODED_LEN {
11419 payload_buf[0..avail_len].copy_from_slice(__input);
11420 Bytes::new(&payload_buf)
11421 } else {
11422 Bytes::new(__input)
11423 };
11424 let mut __struct = Self::default();
11425 __struct.timestamp = buf.get_u64_le();
11426 __struct.custom_state = buf.get_u64_le();
11427 __struct.lat = buf.get_i32_le();
11428 __struct.lon = buf.get_i32_le();
11429 __struct.alt = buf.get_f32_le();
11430 for v in &mut __struct.vel {
11431 let val = buf.get_f32_le();
11432 *v = val;
11433 }
11434 for v in &mut __struct.acc {
11435 let val = buf.get_f32_le();
11436 *v = val;
11437 }
11438 for v in &mut __struct.attitude_q {
11439 let val = buf.get_f32_le();
11440 *v = val;
11441 }
11442 for v in &mut __struct.rates {
11443 let val = buf.get_f32_le();
11444 *v = val;
11445 }
11446 for v in &mut __struct.position_cov {
11447 let val = buf.get_f32_le();
11448 *v = val;
11449 }
11450 __struct.est_capabilities = buf.get_u8();
11451 Ok(__struct)
11452 }
11453 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11454 let mut __tmp = BytesMut::new(bytes);
11455 #[allow(clippy::absurd_extreme_comparisons)]
11456 #[allow(unused_comparisons)]
11457 if __tmp.remaining() < Self::ENCODED_LEN {
11458 panic!(
11459 "buffer is too small (need {} bytes, but got {})",
11460 Self::ENCODED_LEN,
11461 __tmp.remaining(),
11462 )
11463 }
11464 __tmp.put_u64_le(self.timestamp);
11465 __tmp.put_u64_le(self.custom_state);
11466 __tmp.put_i32_le(self.lat);
11467 __tmp.put_i32_le(self.lon);
11468 __tmp.put_f32_le(self.alt);
11469 for val in &self.vel {
11470 __tmp.put_f32_le(*val);
11471 }
11472 for val in &self.acc {
11473 __tmp.put_f32_le(*val);
11474 }
11475 for val in &self.attitude_q {
11476 __tmp.put_f32_le(*val);
11477 }
11478 for val in &self.rates {
11479 __tmp.put_f32_le(*val);
11480 }
11481 for val in &self.position_cov {
11482 __tmp.put_f32_le(*val);
11483 }
11484 __tmp.put_u8(self.est_capabilities);
11485 if matches!(version, MavlinkVersion::V2) {
11486 let len = __tmp.len();
11487 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11488 } else {
11489 __tmp.len()
11490 }
11491 }
11492}
11493#[doc = "id: 371"]
11494#[doc = "Fuel status. This message provides \"generic\" fuel level information for in a GCS and for triggering failsafes in an autopilot. The fuel type and associated units for fields in this message are defined in the enum MAV_FUEL_TYPE. The reported `consumed_fuel` and `remaining_fuel` must only be supplied if measured: they must not be inferred from the `maximum_fuel` and the other value. A recipient can assume that if these fields are supplied they are accurate. If not provided, the recipient can infer `remaining_fuel` from `maximum_fuel` and `consumed_fuel` on the assumption that the fuel was initially at its maximum (this is what battery monitors assume). Note however that this is an assumption, and the UI should prompt the user appropriately (i.e. notify user that they should fill the tank before boot). This kind of information may also be sent in fuel-specific messages such as BATTERY_STATUS_V2. If both messages are sent for the same fuel system, the ids and corresponding information must match. This should be streamed (nominally at 0.1 Hz)."]
11495#[derive(Debug, Clone, PartialEq)]
11496#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11497#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11498pub struct FUEL_STATUS_DATA {
11499 #[doc = "Capacity when full. Must be provided."]
11500 pub maximum_fuel: f32,
11501 #[doc = "Consumed fuel (measured). This value should not be inferred: if not measured set to NaN. NaN: field not provided."]
11502 pub consumed_fuel: f32,
11503 #[doc = "Remaining fuel until empty (measured). The value should not be inferred: if not measured set to NaN. NaN: field not provided."]
11504 pub remaining_fuel: f32,
11505 #[doc = "Positive value when emptying/using, and negative if filling/replacing. NaN: field not provided."]
11506 pub flow_rate: f32,
11507 #[doc = "Fuel temperature. NaN: field not provided."]
11508 pub temperature: f32,
11509 #[doc = "Fuel type. Defines units for fuel capacity and consumption fields above."]
11510 pub fuel_type: MavFuelType,
11511 #[doc = "Fuel ID. Must match ID of other messages for same fuel system, such as BATTERY_STATUS_V2."]
11512 pub id: u8,
11513 #[doc = "Percentage of remaining fuel, relative to full. Values: [0-100], UINT8_MAX: field not provided."]
11514 pub percent_remaining: u8,
11515}
11516impl FUEL_STATUS_DATA {
11517 pub const ENCODED_LEN: usize = 26usize;
11518 pub const DEFAULT: Self = Self {
11519 maximum_fuel: 0.0_f32,
11520 consumed_fuel: 0.0_f32,
11521 remaining_fuel: 0.0_f32,
11522 flow_rate: 0.0_f32,
11523 temperature: 0.0_f32,
11524 fuel_type: MavFuelType::DEFAULT,
11525 id: 0_u8,
11526 percent_remaining: 0_u8,
11527 };
11528 #[cfg(feature = "arbitrary")]
11529 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11530 use arbitrary::{Arbitrary, Unstructured};
11531 let mut buf = [0u8; 1024];
11532 rng.fill_bytes(&mut buf);
11533 let mut unstructured = Unstructured::new(&buf);
11534 Self::arbitrary(&mut unstructured).unwrap_or_default()
11535 }
11536}
11537impl Default for FUEL_STATUS_DATA {
11538 fn default() -> Self {
11539 Self::DEFAULT.clone()
11540 }
11541}
11542impl MessageData for FUEL_STATUS_DATA {
11543 type Message = MavMessage;
11544 const ID: u32 = 371u32;
11545 const NAME: &'static str = "FUEL_STATUS";
11546 const EXTRA_CRC: u8 = 10u8;
11547 const ENCODED_LEN: usize = 26usize;
11548 fn deser(
11549 _version: MavlinkVersion,
11550 __input: &[u8],
11551 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11552 let avail_len = __input.len();
11553 let mut payload_buf = [0; Self::ENCODED_LEN];
11554 let mut buf = if avail_len < Self::ENCODED_LEN {
11555 payload_buf[0..avail_len].copy_from_slice(__input);
11556 Bytes::new(&payload_buf)
11557 } else {
11558 Bytes::new(__input)
11559 };
11560 let mut __struct = Self::default();
11561 __struct.maximum_fuel = buf.get_f32_le();
11562 __struct.consumed_fuel = buf.get_f32_le();
11563 __struct.remaining_fuel = buf.get_f32_le();
11564 __struct.flow_rate = buf.get_f32_le();
11565 __struct.temperature = buf.get_f32_le();
11566 let tmp = buf.get_u32_le();
11567 __struct.fuel_type = FromPrimitive::from_u32(tmp).ok_or(
11568 ::mavlink_core::error::ParserError::InvalidEnum {
11569 enum_type: "MavFuelType",
11570 value: tmp as u32,
11571 },
11572 )?;
11573 __struct.id = buf.get_u8();
11574 __struct.percent_remaining = buf.get_u8();
11575 Ok(__struct)
11576 }
11577 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11578 let mut __tmp = BytesMut::new(bytes);
11579 #[allow(clippy::absurd_extreme_comparisons)]
11580 #[allow(unused_comparisons)]
11581 if __tmp.remaining() < Self::ENCODED_LEN {
11582 panic!(
11583 "buffer is too small (need {} bytes, but got {})",
11584 Self::ENCODED_LEN,
11585 __tmp.remaining(),
11586 )
11587 }
11588 __tmp.put_f32_le(self.maximum_fuel);
11589 __tmp.put_f32_le(self.consumed_fuel);
11590 __tmp.put_f32_le(self.remaining_fuel);
11591 __tmp.put_f32_le(self.flow_rate);
11592 __tmp.put_f32_le(self.temperature);
11593 __tmp.put_u32_le(self.fuel_type as u32);
11594 __tmp.put_u8(self.id);
11595 __tmp.put_u8(self.percent_remaining);
11596 if matches!(version, MavlinkVersion::V2) {
11597 let len = __tmp.len();
11598 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11599 } else {
11600 __tmp.len()
11601 }
11602 }
11603}
11604#[doc = "id: 373"]
11605#[doc = "Telemetry of power generation system. Alternator or mechanical generator."]
11606#[derive(Debug, Clone, PartialEq)]
11607#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11608#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11609pub struct GENERATOR_STATUS_DATA {
11610 #[doc = "Status flags."]
11611 pub status: MavGeneratorStatusFlag,
11612 #[doc = "Current into/out of battery. Positive for out. Negative for in. NaN: field not provided."]
11613 pub battery_current: f32,
11614 #[doc = "Current going to the UAV. If battery current not available this is the DC current from the generator. Positive for out. Negative for in. NaN: field not provided"]
11615 pub load_current: f32,
11616 #[doc = "The power being generated. NaN: field not provided"]
11617 pub power_generated: f32,
11618 #[doc = "Voltage of the bus seen at the generator, or battery bus if battery bus is controlled by generator and at a different voltage to main bus."]
11619 pub bus_voltage: f32,
11620 #[doc = "The target battery current. Positive for out. Negative for in. NaN: field not provided"]
11621 pub bat_current_setpoint: f32,
11622 #[doc = "Seconds this generator has run since it was rebooted. UINT32_MAX: field not provided."]
11623 pub runtime: u32,
11624 #[doc = "Seconds until this generator requires maintenance. A negative value indicates maintenance is past-due. INT32_MAX: field not provided."]
11625 pub time_until_maintenance: i32,
11626 #[doc = "Speed of electrical generator or alternator. UINT16_MAX: field not provided."]
11627 pub generator_speed: u16,
11628 #[doc = "The temperature of the rectifier or power converter. INT16_MAX: field not provided."]
11629 pub rectifier_temperature: i16,
11630 #[doc = "The temperature of the mechanical motor, fuel cell core or generator. INT16_MAX: field not provided."]
11631 pub generator_temperature: i16,
11632}
11633impl GENERATOR_STATUS_DATA {
11634 pub const ENCODED_LEN: usize = 42usize;
11635 pub const DEFAULT: Self = Self {
11636 status: MavGeneratorStatusFlag::DEFAULT,
11637 battery_current: 0.0_f32,
11638 load_current: 0.0_f32,
11639 power_generated: 0.0_f32,
11640 bus_voltage: 0.0_f32,
11641 bat_current_setpoint: 0.0_f32,
11642 runtime: 0_u32,
11643 time_until_maintenance: 0_i32,
11644 generator_speed: 0_u16,
11645 rectifier_temperature: 0_i16,
11646 generator_temperature: 0_i16,
11647 };
11648 #[cfg(feature = "arbitrary")]
11649 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11650 use arbitrary::{Arbitrary, Unstructured};
11651 let mut buf = [0u8; 1024];
11652 rng.fill_bytes(&mut buf);
11653 let mut unstructured = Unstructured::new(&buf);
11654 Self::arbitrary(&mut unstructured).unwrap_or_default()
11655 }
11656}
11657impl Default for GENERATOR_STATUS_DATA {
11658 fn default() -> Self {
11659 Self::DEFAULT.clone()
11660 }
11661}
11662impl MessageData for GENERATOR_STATUS_DATA {
11663 type Message = MavMessage;
11664 const ID: u32 = 373u32;
11665 const NAME: &'static str = "GENERATOR_STATUS";
11666 const EXTRA_CRC: u8 = 117u8;
11667 const ENCODED_LEN: usize = 42usize;
11668 fn deser(
11669 _version: MavlinkVersion,
11670 __input: &[u8],
11671 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11672 let avail_len = __input.len();
11673 let mut payload_buf = [0; Self::ENCODED_LEN];
11674 let mut buf = if avail_len < Self::ENCODED_LEN {
11675 payload_buf[0..avail_len].copy_from_slice(__input);
11676 Bytes::new(&payload_buf)
11677 } else {
11678 Bytes::new(__input)
11679 };
11680 let mut __struct = Self::default();
11681 let tmp = buf.get_u64_le();
11682 __struct.status = MavGeneratorStatusFlag::from_bits(
11683 tmp & MavGeneratorStatusFlag::all().bits(),
11684 )
11685 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
11686 flag_type: "MavGeneratorStatusFlag",
11687 value: tmp as u32,
11688 })?;
11689 __struct.battery_current = buf.get_f32_le();
11690 __struct.load_current = buf.get_f32_le();
11691 __struct.power_generated = buf.get_f32_le();
11692 __struct.bus_voltage = buf.get_f32_le();
11693 __struct.bat_current_setpoint = buf.get_f32_le();
11694 __struct.runtime = buf.get_u32_le();
11695 __struct.time_until_maintenance = buf.get_i32_le();
11696 __struct.generator_speed = buf.get_u16_le();
11697 __struct.rectifier_temperature = buf.get_i16_le();
11698 __struct.generator_temperature = buf.get_i16_le();
11699 Ok(__struct)
11700 }
11701 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11702 let mut __tmp = BytesMut::new(bytes);
11703 #[allow(clippy::absurd_extreme_comparisons)]
11704 #[allow(unused_comparisons)]
11705 if __tmp.remaining() < Self::ENCODED_LEN {
11706 panic!(
11707 "buffer is too small (need {} bytes, but got {})",
11708 Self::ENCODED_LEN,
11709 __tmp.remaining(),
11710 )
11711 }
11712 __tmp.put_u64_le(self.status.bits());
11713 __tmp.put_f32_le(self.battery_current);
11714 __tmp.put_f32_le(self.load_current);
11715 __tmp.put_f32_le(self.power_generated);
11716 __tmp.put_f32_le(self.bus_voltage);
11717 __tmp.put_f32_le(self.bat_current_setpoint);
11718 __tmp.put_u32_le(self.runtime);
11719 __tmp.put_i32_le(self.time_until_maintenance);
11720 __tmp.put_u16_le(self.generator_speed);
11721 __tmp.put_i16_le(self.rectifier_temperature);
11722 __tmp.put_i16_le(self.generator_temperature);
11723 if matches!(version, MavlinkVersion::V2) {
11724 let len = __tmp.len();
11725 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11726 } else {
11727 __tmp.len()
11728 }
11729 }
11730}
11731#[doc = "id: 285"]
11732#[doc = "Message reporting the status of a gimbal device. \t This message should be broadcast by a gimbal device component at a low regular rate (e.g. 5 Hz). \t For the angles encoded in the quaternion and the angular velocities holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME is set, then they are relative to the vehicle heading (vehicle frame). \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is set, then they are relative to absolute North (earth frame). \t If neither of these flags are set, then (for backwards compatibility) it holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set, then they are relative to absolute North (earth frame), \t else they are relative to the vehicle heading (vehicle frame). \t Other conditions of the flags are not allowed. \t The quaternion and angular velocities in the other frame can be calculated from delta_yaw and delta_yaw_velocity as \t q_earth = q_delta_yaw * q_vehicle and w_earth = w_delta_yaw_velocity + w_vehicle (if not NaN). \t If neither the GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME nor the GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME flag is set, \t then (for backwards compatibility) the data in the delta_yaw and delta_yaw_velocity fields are to be ignored. \t New implementations should always set either GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME or GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME, \t and always should set delta_yaw and delta_yaw_velocity either to the proper value or NaN."]
11733#[derive(Debug, Clone, PartialEq)]
11734#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11735#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11736pub struct GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
11737 #[doc = "Timestamp (time since system boot)."]
11738 pub time_boot_ms: u32,
11739 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation). The frame is described in the message description."]
11740 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11741 pub q: [f32; 4],
11742 #[doc = "X component of angular velocity (positive: rolling to the right). The frame is described in the message description. NaN if unknown."]
11743 pub angular_velocity_x: f32,
11744 #[doc = "Y component of angular velocity (positive: pitching up). The frame is described in the message description. NaN if unknown."]
11745 pub angular_velocity_y: f32,
11746 #[doc = "Z component of angular velocity (positive: yawing to the right). The frame is described in the message description. NaN if unknown."]
11747 pub angular_velocity_z: f32,
11748 #[doc = "Failure flags (0 for no failure)"]
11749 pub failure_flags: GimbalDeviceErrorFlags,
11750 #[doc = "Current gimbal flags set."]
11751 pub flags: GimbalDeviceFlags,
11752 #[doc = "System ID"]
11753 pub target_system: u8,
11754 #[doc = "Component ID"]
11755 pub target_component: u8,
11756 #[doc = "Yaw angle relating the quaternions in earth and body frames (see message description). NaN if unknown."]
11757 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
11758 pub delta_yaw: f32,
11759 #[doc = "Yaw angular velocity relating the angular velocities in earth and body frames (see message description). NaN if unknown."]
11760 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
11761 pub delta_yaw_velocity: f32,
11762 #[doc = "This field is to be used if the gimbal manager and the gimbal device are the same component and hence have the same component ID. This field is then set a number between 1-6. If the component ID is separate, this field is not required and must be set to 0."]
11763 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
11764 pub gimbal_device_id: u8,
11765}
11766impl GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
11767 pub const ENCODED_LEN: usize = 49usize;
11768 pub const DEFAULT: Self = Self {
11769 time_boot_ms: 0_u32,
11770 q: [0.0_f32; 4usize],
11771 angular_velocity_x: 0.0_f32,
11772 angular_velocity_y: 0.0_f32,
11773 angular_velocity_z: 0.0_f32,
11774 failure_flags: GimbalDeviceErrorFlags::DEFAULT,
11775 flags: GimbalDeviceFlags::DEFAULT,
11776 target_system: 0_u8,
11777 target_component: 0_u8,
11778 delta_yaw: 0.0_f32,
11779 delta_yaw_velocity: 0.0_f32,
11780 gimbal_device_id: 0_u8,
11781 };
11782 #[cfg(feature = "arbitrary")]
11783 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11784 use arbitrary::{Arbitrary, Unstructured};
11785 let mut buf = [0u8; 1024];
11786 rng.fill_bytes(&mut buf);
11787 let mut unstructured = Unstructured::new(&buf);
11788 Self::arbitrary(&mut unstructured).unwrap_or_default()
11789 }
11790}
11791impl Default for GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
11792 fn default() -> Self {
11793 Self::DEFAULT.clone()
11794 }
11795}
11796impl MessageData for GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
11797 type Message = MavMessage;
11798 const ID: u32 = 285u32;
11799 const NAME: &'static str = "GIMBAL_DEVICE_ATTITUDE_STATUS";
11800 const EXTRA_CRC: u8 = 137u8;
11801 const ENCODED_LEN: usize = 49usize;
11802 fn deser(
11803 _version: MavlinkVersion,
11804 __input: &[u8],
11805 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11806 let avail_len = __input.len();
11807 let mut payload_buf = [0; Self::ENCODED_LEN];
11808 let mut buf = if avail_len < Self::ENCODED_LEN {
11809 payload_buf[0..avail_len].copy_from_slice(__input);
11810 Bytes::new(&payload_buf)
11811 } else {
11812 Bytes::new(__input)
11813 };
11814 let mut __struct = Self::default();
11815 __struct.time_boot_ms = buf.get_u32_le();
11816 for v in &mut __struct.q {
11817 let val = buf.get_f32_le();
11818 *v = val;
11819 }
11820 __struct.angular_velocity_x = buf.get_f32_le();
11821 __struct.angular_velocity_y = buf.get_f32_le();
11822 __struct.angular_velocity_z = buf.get_f32_le();
11823 let tmp = buf.get_u32_le();
11824 __struct.failure_flags = GimbalDeviceErrorFlags::from_bits(
11825 tmp & GimbalDeviceErrorFlags::all().bits(),
11826 )
11827 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
11828 flag_type: "GimbalDeviceErrorFlags",
11829 value: tmp as u32,
11830 })?;
11831 let tmp = buf.get_u16_le();
11832 __struct.flags = GimbalDeviceFlags::from_bits(tmp & GimbalDeviceFlags::all().bits())
11833 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
11834 flag_type: "GimbalDeviceFlags",
11835 value: tmp as u32,
11836 })?;
11837 __struct.target_system = buf.get_u8();
11838 __struct.target_component = buf.get_u8();
11839 __struct.delta_yaw = buf.get_f32_le();
11840 __struct.delta_yaw_velocity = buf.get_f32_le();
11841 __struct.gimbal_device_id = buf.get_u8();
11842 Ok(__struct)
11843 }
11844 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11845 let mut __tmp = BytesMut::new(bytes);
11846 #[allow(clippy::absurd_extreme_comparisons)]
11847 #[allow(unused_comparisons)]
11848 if __tmp.remaining() < Self::ENCODED_LEN {
11849 panic!(
11850 "buffer is too small (need {} bytes, but got {})",
11851 Self::ENCODED_LEN,
11852 __tmp.remaining(),
11853 )
11854 }
11855 __tmp.put_u32_le(self.time_boot_ms);
11856 for val in &self.q {
11857 __tmp.put_f32_le(*val);
11858 }
11859 __tmp.put_f32_le(self.angular_velocity_x);
11860 __tmp.put_f32_le(self.angular_velocity_y);
11861 __tmp.put_f32_le(self.angular_velocity_z);
11862 __tmp.put_u32_le(self.failure_flags.bits());
11863 __tmp.put_u16_le(self.flags.bits());
11864 __tmp.put_u8(self.target_system);
11865 __tmp.put_u8(self.target_component);
11866 __tmp.put_f32_le(self.delta_yaw);
11867 __tmp.put_f32_le(self.delta_yaw_velocity);
11868 __tmp.put_u8(self.gimbal_device_id);
11869 if matches!(version, MavlinkVersion::V2) {
11870 let len = __tmp.len();
11871 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11872 } else {
11873 __tmp.len()
11874 }
11875 }
11876}
11877#[doc = "id: 283"]
11878#[doc = "Information about a low level gimbal. This message should be requested by the gimbal manager or a ground station using MAV_CMD_REQUEST_MESSAGE. The maximum angles and rates are the limits by hardware. However, the limits by software used are likely different/smaller and dependent on mode/settings/etc.."]
11879#[derive(Debug, Clone, PartialEq)]
11880#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11881#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11882pub struct GIMBAL_DEVICE_INFORMATION_DATA {
11883 #[doc = "UID of gimbal hardware (0 if unknown)."]
11884 pub uid: u64,
11885 #[doc = "Timestamp (time since system boot)."]
11886 pub time_boot_ms: u32,
11887 #[doc = "0xff)."]
11888 pub firmware_version: u32,
11889 #[doc = "0xff)."]
11890 pub hardware_version: u32,
11891 #[doc = "Minimum hardware roll angle (positive: rolling to the right, negative: rolling to the left). NAN if unknown."]
11892 pub roll_min: f32,
11893 #[doc = "Maximum hardware roll angle (positive: rolling to the right, negative: rolling to the left). NAN if unknown."]
11894 pub roll_max: f32,
11895 #[doc = "Minimum hardware pitch angle (positive: up, negative: down). NAN if unknown."]
11896 pub pitch_min: f32,
11897 #[doc = "Maximum hardware pitch angle (positive: up, negative: down). NAN if unknown."]
11898 pub pitch_max: f32,
11899 #[doc = "Minimum hardware yaw angle (positive: to the right, negative: to the left). NAN if unknown."]
11900 pub yaw_min: f32,
11901 #[doc = "Maximum hardware yaw angle (positive: to the right, negative: to the left). NAN if unknown."]
11902 pub yaw_max: f32,
11903 #[doc = "Bitmap of gimbal capability flags."]
11904 pub cap_flags: GimbalDeviceCapFlags,
11905 #[doc = "Bitmap for use for gimbal-specific capability flags."]
11906 pub custom_cap_flags: u16,
11907 #[doc = "Name of the gimbal vendor."]
11908 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11909 pub vendor_name: [u8; 32],
11910 #[doc = "Name of the gimbal model."]
11911 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11912 pub model_name: [u8; 32],
11913 #[doc = "Custom name of the gimbal given to it by the user."]
11914 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11915 pub custom_name: [u8; 32],
11916 #[doc = "This field is to be used if the gimbal manager and the gimbal device are the same component and hence have the same component ID. This field is then set to a number between 1-6. If the component ID is separate, this field is not required and must be set to 0."]
11917 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
11918 pub gimbal_device_id: u8,
11919}
11920impl GIMBAL_DEVICE_INFORMATION_DATA {
11921 pub const ENCODED_LEN: usize = 145usize;
11922 pub const DEFAULT: Self = Self {
11923 uid: 0_u64,
11924 time_boot_ms: 0_u32,
11925 firmware_version: 0_u32,
11926 hardware_version: 0_u32,
11927 roll_min: 0.0_f32,
11928 roll_max: 0.0_f32,
11929 pitch_min: 0.0_f32,
11930 pitch_max: 0.0_f32,
11931 yaw_min: 0.0_f32,
11932 yaw_max: 0.0_f32,
11933 cap_flags: GimbalDeviceCapFlags::DEFAULT,
11934 custom_cap_flags: 0_u16,
11935 vendor_name: [0_u8; 32usize],
11936 model_name: [0_u8; 32usize],
11937 custom_name: [0_u8; 32usize],
11938 gimbal_device_id: 0_u8,
11939 };
11940 #[cfg(feature = "arbitrary")]
11941 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11942 use arbitrary::{Arbitrary, Unstructured};
11943 let mut buf = [0u8; 1024];
11944 rng.fill_bytes(&mut buf);
11945 let mut unstructured = Unstructured::new(&buf);
11946 Self::arbitrary(&mut unstructured).unwrap_or_default()
11947 }
11948}
11949impl Default for GIMBAL_DEVICE_INFORMATION_DATA {
11950 fn default() -> Self {
11951 Self::DEFAULT.clone()
11952 }
11953}
11954impl MessageData for GIMBAL_DEVICE_INFORMATION_DATA {
11955 type Message = MavMessage;
11956 const ID: u32 = 283u32;
11957 const NAME: &'static str = "GIMBAL_DEVICE_INFORMATION";
11958 const EXTRA_CRC: u8 = 74u8;
11959 const ENCODED_LEN: usize = 145usize;
11960 fn deser(
11961 _version: MavlinkVersion,
11962 __input: &[u8],
11963 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11964 let avail_len = __input.len();
11965 let mut payload_buf = [0; Self::ENCODED_LEN];
11966 let mut buf = if avail_len < Self::ENCODED_LEN {
11967 payload_buf[0..avail_len].copy_from_slice(__input);
11968 Bytes::new(&payload_buf)
11969 } else {
11970 Bytes::new(__input)
11971 };
11972 let mut __struct = Self::default();
11973 __struct.uid = buf.get_u64_le();
11974 __struct.time_boot_ms = buf.get_u32_le();
11975 __struct.firmware_version = buf.get_u32_le();
11976 __struct.hardware_version = buf.get_u32_le();
11977 __struct.roll_min = buf.get_f32_le();
11978 __struct.roll_max = buf.get_f32_le();
11979 __struct.pitch_min = buf.get_f32_le();
11980 __struct.pitch_max = buf.get_f32_le();
11981 __struct.yaw_min = buf.get_f32_le();
11982 __struct.yaw_max = buf.get_f32_le();
11983 let tmp = buf.get_u16_le();
11984 __struct.cap_flags = GimbalDeviceCapFlags::from_bits(
11985 tmp & GimbalDeviceCapFlags::all().bits(),
11986 )
11987 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
11988 flag_type: "GimbalDeviceCapFlags",
11989 value: tmp as u32,
11990 })?;
11991 __struct.custom_cap_flags = buf.get_u16_le();
11992 for v in &mut __struct.vendor_name {
11993 let val = buf.get_u8();
11994 *v = val;
11995 }
11996 for v in &mut __struct.model_name {
11997 let val = buf.get_u8();
11998 *v = val;
11999 }
12000 for v in &mut __struct.custom_name {
12001 let val = buf.get_u8();
12002 *v = val;
12003 }
12004 __struct.gimbal_device_id = buf.get_u8();
12005 Ok(__struct)
12006 }
12007 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12008 let mut __tmp = BytesMut::new(bytes);
12009 #[allow(clippy::absurd_extreme_comparisons)]
12010 #[allow(unused_comparisons)]
12011 if __tmp.remaining() < Self::ENCODED_LEN {
12012 panic!(
12013 "buffer is too small (need {} bytes, but got {})",
12014 Self::ENCODED_LEN,
12015 __tmp.remaining(),
12016 )
12017 }
12018 __tmp.put_u64_le(self.uid);
12019 __tmp.put_u32_le(self.time_boot_ms);
12020 __tmp.put_u32_le(self.firmware_version);
12021 __tmp.put_u32_le(self.hardware_version);
12022 __tmp.put_f32_le(self.roll_min);
12023 __tmp.put_f32_le(self.roll_max);
12024 __tmp.put_f32_le(self.pitch_min);
12025 __tmp.put_f32_le(self.pitch_max);
12026 __tmp.put_f32_le(self.yaw_min);
12027 __tmp.put_f32_le(self.yaw_max);
12028 __tmp.put_u16_le(self.cap_flags.bits());
12029 __tmp.put_u16_le(self.custom_cap_flags);
12030 for val in &self.vendor_name {
12031 __tmp.put_u8(*val);
12032 }
12033 for val in &self.model_name {
12034 __tmp.put_u8(*val);
12035 }
12036 for val in &self.custom_name {
12037 __tmp.put_u8(*val);
12038 }
12039 __tmp.put_u8(self.gimbal_device_id);
12040 if matches!(version, MavlinkVersion::V2) {
12041 let len = __tmp.len();
12042 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12043 } else {
12044 __tmp.len()
12045 }
12046 }
12047}
12048#[doc = "id: 284"]
12049#[doc = "Low level message to control a gimbal device's attitude. \t This message is to be sent from the gimbal manager to the gimbal device component. \t The quaternion and angular velocities can be set to NaN according to use case. \t For the angles encoded in the quaternion and the angular velocities holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME is set, then they are relative to the vehicle heading (vehicle frame). \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is set, then they are relative to absolute North (earth frame). \t If neither of these flags are set, then (for backwards compatibility) it holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set, then they are relative to absolute North (earth frame), \t else they are relative to the vehicle heading (vehicle frame). \t Setting both GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME and GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is not allowed. \t These rules are to ensure backwards compatibility. \t New implementations should always set either GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME or GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME."]
12050#[derive(Debug, Clone, PartialEq)]
12051#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12052#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12053pub struct GIMBAL_DEVICE_SET_ATTITUDE_DATA {
12054 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation). The frame is described in the message description. Set fields to NaN to be ignored."]
12055 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12056 pub q: [f32; 4],
12057 #[doc = "X component of angular velocity (positive: rolling to the right). The frame is described in the message description. NaN to be ignored."]
12058 pub angular_velocity_x: f32,
12059 #[doc = "Y component of angular velocity (positive: pitching up). The frame is described in the message description. NaN to be ignored."]
12060 pub angular_velocity_y: f32,
12061 #[doc = "Z component of angular velocity (positive: yawing to the right). The frame is described in the message description. NaN to be ignored."]
12062 pub angular_velocity_z: f32,
12063 #[doc = "Low level gimbal flags."]
12064 pub flags: GimbalDeviceFlags,
12065 #[doc = "System ID"]
12066 pub target_system: u8,
12067 #[doc = "Component ID"]
12068 pub target_component: u8,
12069}
12070impl GIMBAL_DEVICE_SET_ATTITUDE_DATA {
12071 pub const ENCODED_LEN: usize = 32usize;
12072 pub const DEFAULT: Self = Self {
12073 q: [0.0_f32; 4usize],
12074 angular_velocity_x: 0.0_f32,
12075 angular_velocity_y: 0.0_f32,
12076 angular_velocity_z: 0.0_f32,
12077 flags: GimbalDeviceFlags::DEFAULT,
12078 target_system: 0_u8,
12079 target_component: 0_u8,
12080 };
12081 #[cfg(feature = "arbitrary")]
12082 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12083 use arbitrary::{Arbitrary, Unstructured};
12084 let mut buf = [0u8; 1024];
12085 rng.fill_bytes(&mut buf);
12086 let mut unstructured = Unstructured::new(&buf);
12087 Self::arbitrary(&mut unstructured).unwrap_or_default()
12088 }
12089}
12090impl Default for GIMBAL_DEVICE_SET_ATTITUDE_DATA {
12091 fn default() -> Self {
12092 Self::DEFAULT.clone()
12093 }
12094}
12095impl MessageData for GIMBAL_DEVICE_SET_ATTITUDE_DATA {
12096 type Message = MavMessage;
12097 const ID: u32 = 284u32;
12098 const NAME: &'static str = "GIMBAL_DEVICE_SET_ATTITUDE";
12099 const EXTRA_CRC: u8 = 99u8;
12100 const ENCODED_LEN: usize = 32usize;
12101 fn deser(
12102 _version: MavlinkVersion,
12103 __input: &[u8],
12104 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12105 let avail_len = __input.len();
12106 let mut payload_buf = [0; Self::ENCODED_LEN];
12107 let mut buf = if avail_len < Self::ENCODED_LEN {
12108 payload_buf[0..avail_len].copy_from_slice(__input);
12109 Bytes::new(&payload_buf)
12110 } else {
12111 Bytes::new(__input)
12112 };
12113 let mut __struct = Self::default();
12114 for v in &mut __struct.q {
12115 let val = buf.get_f32_le();
12116 *v = val;
12117 }
12118 __struct.angular_velocity_x = buf.get_f32_le();
12119 __struct.angular_velocity_y = buf.get_f32_le();
12120 __struct.angular_velocity_z = buf.get_f32_le();
12121 let tmp = buf.get_u16_le();
12122 __struct.flags = GimbalDeviceFlags::from_bits(tmp & GimbalDeviceFlags::all().bits())
12123 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12124 flag_type: "GimbalDeviceFlags",
12125 value: tmp as u32,
12126 })?;
12127 __struct.target_system = buf.get_u8();
12128 __struct.target_component = buf.get_u8();
12129 Ok(__struct)
12130 }
12131 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12132 let mut __tmp = BytesMut::new(bytes);
12133 #[allow(clippy::absurd_extreme_comparisons)]
12134 #[allow(unused_comparisons)]
12135 if __tmp.remaining() < Self::ENCODED_LEN {
12136 panic!(
12137 "buffer is too small (need {} bytes, but got {})",
12138 Self::ENCODED_LEN,
12139 __tmp.remaining(),
12140 )
12141 }
12142 for val in &self.q {
12143 __tmp.put_f32_le(*val);
12144 }
12145 __tmp.put_f32_le(self.angular_velocity_x);
12146 __tmp.put_f32_le(self.angular_velocity_y);
12147 __tmp.put_f32_le(self.angular_velocity_z);
12148 __tmp.put_u16_le(self.flags.bits());
12149 __tmp.put_u8(self.target_system);
12150 __tmp.put_u8(self.target_component);
12151 if matches!(version, MavlinkVersion::V2) {
12152 let len = __tmp.len();
12153 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12154 } else {
12155 __tmp.len()
12156 }
12157 }
12158}
12159#[doc = "id: 280"]
12160#[doc = "Information about a high level gimbal manager. This message should be requested by a ground station using MAV_CMD_REQUEST_MESSAGE."]
12161#[derive(Debug, Clone, PartialEq)]
12162#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12163#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12164pub struct GIMBAL_MANAGER_INFORMATION_DATA {
12165 #[doc = "Timestamp (time since system boot)."]
12166 pub time_boot_ms: u32,
12167 #[doc = "Bitmap of gimbal capability flags."]
12168 pub cap_flags: GimbalManagerCapFlags,
12169 #[doc = "Minimum hardware roll angle (positive: rolling to the right, negative: rolling to the left)"]
12170 pub roll_min: f32,
12171 #[doc = "Maximum hardware roll angle (positive: rolling to the right, negative: rolling to the left)"]
12172 pub roll_max: f32,
12173 #[doc = "Minimum pitch angle (positive: up, negative: down)"]
12174 pub pitch_min: f32,
12175 #[doc = "Maximum pitch angle (positive: up, negative: down)"]
12176 pub pitch_max: f32,
12177 #[doc = "Minimum yaw angle (positive: to the right, negative: to the left)"]
12178 pub yaw_min: f32,
12179 #[doc = "Maximum yaw angle (positive: to the right, negative: to the left)"]
12180 pub yaw_max: f32,
12181 #[doc = "Gimbal device ID that this gimbal manager is responsible for. Component ID of gimbal device (or 1-6 for non-MAVLink gimbal)."]
12182 pub gimbal_device_id: u8,
12183}
12184impl GIMBAL_MANAGER_INFORMATION_DATA {
12185 pub const ENCODED_LEN: usize = 33usize;
12186 pub const DEFAULT: Self = Self {
12187 time_boot_ms: 0_u32,
12188 cap_flags: GimbalManagerCapFlags::DEFAULT,
12189 roll_min: 0.0_f32,
12190 roll_max: 0.0_f32,
12191 pitch_min: 0.0_f32,
12192 pitch_max: 0.0_f32,
12193 yaw_min: 0.0_f32,
12194 yaw_max: 0.0_f32,
12195 gimbal_device_id: 0_u8,
12196 };
12197 #[cfg(feature = "arbitrary")]
12198 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12199 use arbitrary::{Arbitrary, Unstructured};
12200 let mut buf = [0u8; 1024];
12201 rng.fill_bytes(&mut buf);
12202 let mut unstructured = Unstructured::new(&buf);
12203 Self::arbitrary(&mut unstructured).unwrap_or_default()
12204 }
12205}
12206impl Default for GIMBAL_MANAGER_INFORMATION_DATA {
12207 fn default() -> Self {
12208 Self::DEFAULT.clone()
12209 }
12210}
12211impl MessageData for GIMBAL_MANAGER_INFORMATION_DATA {
12212 type Message = MavMessage;
12213 const ID: u32 = 280u32;
12214 const NAME: &'static str = "GIMBAL_MANAGER_INFORMATION";
12215 const EXTRA_CRC: u8 = 70u8;
12216 const ENCODED_LEN: usize = 33usize;
12217 fn deser(
12218 _version: MavlinkVersion,
12219 __input: &[u8],
12220 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12221 let avail_len = __input.len();
12222 let mut payload_buf = [0; Self::ENCODED_LEN];
12223 let mut buf = if avail_len < Self::ENCODED_LEN {
12224 payload_buf[0..avail_len].copy_from_slice(__input);
12225 Bytes::new(&payload_buf)
12226 } else {
12227 Bytes::new(__input)
12228 };
12229 let mut __struct = Self::default();
12230 __struct.time_boot_ms = buf.get_u32_le();
12231 let tmp = buf.get_u32_le();
12232 __struct.cap_flags = GimbalManagerCapFlags::from_bits(
12233 tmp & GimbalManagerCapFlags::all().bits(),
12234 )
12235 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12236 flag_type: "GimbalManagerCapFlags",
12237 value: tmp as u32,
12238 })?;
12239 __struct.roll_min = buf.get_f32_le();
12240 __struct.roll_max = buf.get_f32_le();
12241 __struct.pitch_min = buf.get_f32_le();
12242 __struct.pitch_max = buf.get_f32_le();
12243 __struct.yaw_min = buf.get_f32_le();
12244 __struct.yaw_max = buf.get_f32_le();
12245 __struct.gimbal_device_id = buf.get_u8();
12246 Ok(__struct)
12247 }
12248 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12249 let mut __tmp = BytesMut::new(bytes);
12250 #[allow(clippy::absurd_extreme_comparisons)]
12251 #[allow(unused_comparisons)]
12252 if __tmp.remaining() < Self::ENCODED_LEN {
12253 panic!(
12254 "buffer is too small (need {} bytes, but got {})",
12255 Self::ENCODED_LEN,
12256 __tmp.remaining(),
12257 )
12258 }
12259 __tmp.put_u32_le(self.time_boot_ms);
12260 __tmp.put_u32_le(self.cap_flags.bits());
12261 __tmp.put_f32_le(self.roll_min);
12262 __tmp.put_f32_le(self.roll_max);
12263 __tmp.put_f32_le(self.pitch_min);
12264 __tmp.put_f32_le(self.pitch_max);
12265 __tmp.put_f32_le(self.yaw_min);
12266 __tmp.put_f32_le(self.yaw_max);
12267 __tmp.put_u8(self.gimbal_device_id);
12268 if matches!(version, MavlinkVersion::V2) {
12269 let len = __tmp.len();
12270 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12271 } else {
12272 __tmp.len()
12273 }
12274 }
12275}
12276#[doc = "id: 282"]
12277#[doc = "High level message to control a gimbal's attitude. This message is to be sent to the gimbal manager (e.g. from a ground station). Angles and rates can be set to NaN according to use case."]
12278#[derive(Debug, Clone, PartialEq)]
12279#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12280#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12281pub struct GIMBAL_MANAGER_SET_ATTITUDE_DATA {
12282 #[doc = "High level gimbal manager flags to use."]
12283 pub flags: GimbalManagerFlags,
12284 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation, the frame is depends on whether the flag GIMBAL_MANAGER_FLAGS_YAW_LOCK is set)"]
12285 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12286 pub q: [f32; 4],
12287 #[doc = "X component of angular velocity, positive is rolling to the right, NaN to be ignored."]
12288 pub angular_velocity_x: f32,
12289 #[doc = "Y component of angular velocity, positive is pitching up, NaN to be ignored."]
12290 pub angular_velocity_y: f32,
12291 #[doc = "Z component of angular velocity, positive is yawing to the right, NaN to be ignored."]
12292 pub angular_velocity_z: f32,
12293 #[doc = "System ID"]
12294 pub target_system: u8,
12295 #[doc = "Component ID"]
12296 pub target_component: u8,
12297 #[doc = "Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. Send command multiple times for more than one gimbal (but not all gimbals)."]
12298 pub gimbal_device_id: u8,
12299}
12300impl GIMBAL_MANAGER_SET_ATTITUDE_DATA {
12301 pub const ENCODED_LEN: usize = 35usize;
12302 pub const DEFAULT: Self = Self {
12303 flags: GimbalManagerFlags::DEFAULT,
12304 q: [0.0_f32; 4usize],
12305 angular_velocity_x: 0.0_f32,
12306 angular_velocity_y: 0.0_f32,
12307 angular_velocity_z: 0.0_f32,
12308 target_system: 0_u8,
12309 target_component: 0_u8,
12310 gimbal_device_id: 0_u8,
12311 };
12312 #[cfg(feature = "arbitrary")]
12313 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12314 use arbitrary::{Arbitrary, Unstructured};
12315 let mut buf = [0u8; 1024];
12316 rng.fill_bytes(&mut buf);
12317 let mut unstructured = Unstructured::new(&buf);
12318 Self::arbitrary(&mut unstructured).unwrap_or_default()
12319 }
12320}
12321impl Default for GIMBAL_MANAGER_SET_ATTITUDE_DATA {
12322 fn default() -> Self {
12323 Self::DEFAULT.clone()
12324 }
12325}
12326impl MessageData for GIMBAL_MANAGER_SET_ATTITUDE_DATA {
12327 type Message = MavMessage;
12328 const ID: u32 = 282u32;
12329 const NAME: &'static str = "GIMBAL_MANAGER_SET_ATTITUDE";
12330 const EXTRA_CRC: u8 = 123u8;
12331 const ENCODED_LEN: usize = 35usize;
12332 fn deser(
12333 _version: MavlinkVersion,
12334 __input: &[u8],
12335 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12336 let avail_len = __input.len();
12337 let mut payload_buf = [0; Self::ENCODED_LEN];
12338 let mut buf = if avail_len < Self::ENCODED_LEN {
12339 payload_buf[0..avail_len].copy_from_slice(__input);
12340 Bytes::new(&payload_buf)
12341 } else {
12342 Bytes::new(__input)
12343 };
12344 let mut __struct = Self::default();
12345 let tmp = buf.get_u32_le();
12346 __struct.flags = GimbalManagerFlags::from_bits(tmp & GimbalManagerFlags::all().bits())
12347 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12348 flag_type: "GimbalManagerFlags",
12349 value: tmp as u32,
12350 })?;
12351 for v in &mut __struct.q {
12352 let val = buf.get_f32_le();
12353 *v = val;
12354 }
12355 __struct.angular_velocity_x = buf.get_f32_le();
12356 __struct.angular_velocity_y = buf.get_f32_le();
12357 __struct.angular_velocity_z = buf.get_f32_le();
12358 __struct.target_system = buf.get_u8();
12359 __struct.target_component = buf.get_u8();
12360 __struct.gimbal_device_id = buf.get_u8();
12361 Ok(__struct)
12362 }
12363 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12364 let mut __tmp = BytesMut::new(bytes);
12365 #[allow(clippy::absurd_extreme_comparisons)]
12366 #[allow(unused_comparisons)]
12367 if __tmp.remaining() < Self::ENCODED_LEN {
12368 panic!(
12369 "buffer is too small (need {} bytes, but got {})",
12370 Self::ENCODED_LEN,
12371 __tmp.remaining(),
12372 )
12373 }
12374 __tmp.put_u32_le(self.flags.bits());
12375 for val in &self.q {
12376 __tmp.put_f32_le(*val);
12377 }
12378 __tmp.put_f32_le(self.angular_velocity_x);
12379 __tmp.put_f32_le(self.angular_velocity_y);
12380 __tmp.put_f32_le(self.angular_velocity_z);
12381 __tmp.put_u8(self.target_system);
12382 __tmp.put_u8(self.target_component);
12383 __tmp.put_u8(self.gimbal_device_id);
12384 if matches!(version, MavlinkVersion::V2) {
12385 let len = __tmp.len();
12386 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12387 } else {
12388 __tmp.len()
12389 }
12390 }
12391}
12392#[doc = "id: 288"]
12393#[doc = "High level message to control a gimbal manually. The angles or angular rates are unitless; the actual rates will depend on internal gimbal manager settings/configuration (e.g. set by parameters). This message is to be sent to the gimbal manager (e.g. from a ground station). Angles and rates can be set to NaN according to use case."]
12394#[derive(Debug, Clone, PartialEq)]
12395#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12396#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12397pub struct GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
12398 #[doc = "High level gimbal manager flags."]
12399 pub flags: GimbalManagerFlags,
12400 #[doc = "Pitch angle unitless (-1..1, positive: up, negative: down, NaN to be ignored)."]
12401 pub pitch: f32,
12402 #[doc = "Yaw angle unitless (-1..1, positive: to the right, negative: to the left, NaN to be ignored)."]
12403 pub yaw: f32,
12404 #[doc = "Pitch angular rate unitless (-1..1, positive: up, negative: down, NaN to be ignored)."]
12405 pub pitch_rate: f32,
12406 #[doc = "Yaw angular rate unitless (-1..1, positive: to the right, negative: to the left, NaN to be ignored)."]
12407 pub yaw_rate: f32,
12408 #[doc = "System ID"]
12409 pub target_system: u8,
12410 #[doc = "Component ID"]
12411 pub target_component: u8,
12412 #[doc = "Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. Send command multiple times for more than one gimbal (but not all gimbals)."]
12413 pub gimbal_device_id: u8,
12414}
12415impl GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
12416 pub const ENCODED_LEN: usize = 23usize;
12417 pub const DEFAULT: Self = Self {
12418 flags: GimbalManagerFlags::DEFAULT,
12419 pitch: 0.0_f32,
12420 yaw: 0.0_f32,
12421 pitch_rate: 0.0_f32,
12422 yaw_rate: 0.0_f32,
12423 target_system: 0_u8,
12424 target_component: 0_u8,
12425 gimbal_device_id: 0_u8,
12426 };
12427 #[cfg(feature = "arbitrary")]
12428 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12429 use arbitrary::{Arbitrary, Unstructured};
12430 let mut buf = [0u8; 1024];
12431 rng.fill_bytes(&mut buf);
12432 let mut unstructured = Unstructured::new(&buf);
12433 Self::arbitrary(&mut unstructured).unwrap_or_default()
12434 }
12435}
12436impl Default for GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
12437 fn default() -> Self {
12438 Self::DEFAULT.clone()
12439 }
12440}
12441impl MessageData for GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
12442 type Message = MavMessage;
12443 const ID: u32 = 288u32;
12444 const NAME: &'static str = "GIMBAL_MANAGER_SET_MANUAL_CONTROL";
12445 const EXTRA_CRC: u8 = 20u8;
12446 const ENCODED_LEN: usize = 23usize;
12447 fn deser(
12448 _version: MavlinkVersion,
12449 __input: &[u8],
12450 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12451 let avail_len = __input.len();
12452 let mut payload_buf = [0; Self::ENCODED_LEN];
12453 let mut buf = if avail_len < Self::ENCODED_LEN {
12454 payload_buf[0..avail_len].copy_from_slice(__input);
12455 Bytes::new(&payload_buf)
12456 } else {
12457 Bytes::new(__input)
12458 };
12459 let mut __struct = Self::default();
12460 let tmp = buf.get_u32_le();
12461 __struct.flags = GimbalManagerFlags::from_bits(tmp & GimbalManagerFlags::all().bits())
12462 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12463 flag_type: "GimbalManagerFlags",
12464 value: tmp as u32,
12465 })?;
12466 __struct.pitch = buf.get_f32_le();
12467 __struct.yaw = buf.get_f32_le();
12468 __struct.pitch_rate = buf.get_f32_le();
12469 __struct.yaw_rate = buf.get_f32_le();
12470 __struct.target_system = buf.get_u8();
12471 __struct.target_component = buf.get_u8();
12472 __struct.gimbal_device_id = buf.get_u8();
12473 Ok(__struct)
12474 }
12475 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12476 let mut __tmp = BytesMut::new(bytes);
12477 #[allow(clippy::absurd_extreme_comparisons)]
12478 #[allow(unused_comparisons)]
12479 if __tmp.remaining() < Self::ENCODED_LEN {
12480 panic!(
12481 "buffer is too small (need {} bytes, but got {})",
12482 Self::ENCODED_LEN,
12483 __tmp.remaining(),
12484 )
12485 }
12486 __tmp.put_u32_le(self.flags.bits());
12487 __tmp.put_f32_le(self.pitch);
12488 __tmp.put_f32_le(self.yaw);
12489 __tmp.put_f32_le(self.pitch_rate);
12490 __tmp.put_f32_le(self.yaw_rate);
12491 __tmp.put_u8(self.target_system);
12492 __tmp.put_u8(self.target_component);
12493 __tmp.put_u8(self.gimbal_device_id);
12494 if matches!(version, MavlinkVersion::V2) {
12495 let len = __tmp.len();
12496 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12497 } else {
12498 __tmp.len()
12499 }
12500 }
12501}
12502#[doc = "id: 287"]
12503#[doc = "Set gimbal manager pitch and yaw angles (high rate message). This message is to be sent to the gimbal manager (e.g. from a ground station) and will be ignored by gimbal devices. Angles and rates can be set to NaN according to use case. Use MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW for low-rate adjustments that require confirmation."]
12504#[derive(Debug, Clone, PartialEq)]
12505#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12506#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12507pub struct GIMBAL_MANAGER_SET_PITCHYAW_DATA {
12508 #[doc = "High level gimbal manager flags to use."]
12509 pub flags: GimbalManagerFlags,
12510 #[doc = "Pitch angle (positive: up, negative: down, NaN to be ignored)."]
12511 pub pitch: f32,
12512 #[doc = "Yaw angle (positive: to the right, negative: to the left, NaN to be ignored)."]
12513 pub yaw: f32,
12514 #[doc = "Pitch angular rate (positive: up, negative: down, NaN to be ignored)."]
12515 pub pitch_rate: f32,
12516 #[doc = "Yaw angular rate (positive: to the right, negative: to the left, NaN to be ignored)."]
12517 pub yaw_rate: f32,
12518 #[doc = "System ID"]
12519 pub target_system: u8,
12520 #[doc = "Component ID"]
12521 pub target_component: u8,
12522 #[doc = "Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. Send command multiple times for more than one gimbal (but not all gimbals)."]
12523 pub gimbal_device_id: u8,
12524}
12525impl GIMBAL_MANAGER_SET_PITCHYAW_DATA {
12526 pub const ENCODED_LEN: usize = 23usize;
12527 pub const DEFAULT: Self = Self {
12528 flags: GimbalManagerFlags::DEFAULT,
12529 pitch: 0.0_f32,
12530 yaw: 0.0_f32,
12531 pitch_rate: 0.0_f32,
12532 yaw_rate: 0.0_f32,
12533 target_system: 0_u8,
12534 target_component: 0_u8,
12535 gimbal_device_id: 0_u8,
12536 };
12537 #[cfg(feature = "arbitrary")]
12538 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12539 use arbitrary::{Arbitrary, Unstructured};
12540 let mut buf = [0u8; 1024];
12541 rng.fill_bytes(&mut buf);
12542 let mut unstructured = Unstructured::new(&buf);
12543 Self::arbitrary(&mut unstructured).unwrap_or_default()
12544 }
12545}
12546impl Default for GIMBAL_MANAGER_SET_PITCHYAW_DATA {
12547 fn default() -> Self {
12548 Self::DEFAULT.clone()
12549 }
12550}
12551impl MessageData for GIMBAL_MANAGER_SET_PITCHYAW_DATA {
12552 type Message = MavMessage;
12553 const ID: u32 = 287u32;
12554 const NAME: &'static str = "GIMBAL_MANAGER_SET_PITCHYAW";
12555 const EXTRA_CRC: u8 = 1u8;
12556 const ENCODED_LEN: usize = 23usize;
12557 fn deser(
12558 _version: MavlinkVersion,
12559 __input: &[u8],
12560 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12561 let avail_len = __input.len();
12562 let mut payload_buf = [0; Self::ENCODED_LEN];
12563 let mut buf = if avail_len < Self::ENCODED_LEN {
12564 payload_buf[0..avail_len].copy_from_slice(__input);
12565 Bytes::new(&payload_buf)
12566 } else {
12567 Bytes::new(__input)
12568 };
12569 let mut __struct = Self::default();
12570 let tmp = buf.get_u32_le();
12571 __struct.flags = GimbalManagerFlags::from_bits(tmp & GimbalManagerFlags::all().bits())
12572 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12573 flag_type: "GimbalManagerFlags",
12574 value: tmp as u32,
12575 })?;
12576 __struct.pitch = buf.get_f32_le();
12577 __struct.yaw = buf.get_f32_le();
12578 __struct.pitch_rate = buf.get_f32_le();
12579 __struct.yaw_rate = buf.get_f32_le();
12580 __struct.target_system = buf.get_u8();
12581 __struct.target_component = buf.get_u8();
12582 __struct.gimbal_device_id = buf.get_u8();
12583 Ok(__struct)
12584 }
12585 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12586 let mut __tmp = BytesMut::new(bytes);
12587 #[allow(clippy::absurd_extreme_comparisons)]
12588 #[allow(unused_comparisons)]
12589 if __tmp.remaining() < Self::ENCODED_LEN {
12590 panic!(
12591 "buffer is too small (need {} bytes, but got {})",
12592 Self::ENCODED_LEN,
12593 __tmp.remaining(),
12594 )
12595 }
12596 __tmp.put_u32_le(self.flags.bits());
12597 __tmp.put_f32_le(self.pitch);
12598 __tmp.put_f32_le(self.yaw);
12599 __tmp.put_f32_le(self.pitch_rate);
12600 __tmp.put_f32_le(self.yaw_rate);
12601 __tmp.put_u8(self.target_system);
12602 __tmp.put_u8(self.target_component);
12603 __tmp.put_u8(self.gimbal_device_id);
12604 if matches!(version, MavlinkVersion::V2) {
12605 let len = __tmp.len();
12606 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12607 } else {
12608 __tmp.len()
12609 }
12610 }
12611}
12612#[doc = "id: 281"]
12613#[doc = "Current status about a high level gimbal manager. This message should be broadcast at a low regular rate (e.g. 5Hz)."]
12614#[derive(Debug, Clone, PartialEq)]
12615#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12616#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12617pub struct GIMBAL_MANAGER_STATUS_DATA {
12618 #[doc = "Timestamp (time since system boot)."]
12619 pub time_boot_ms: u32,
12620 #[doc = "High level gimbal manager flags currently applied."]
12621 pub flags: GimbalManagerFlags,
12622 #[doc = "Gimbal device ID that this gimbal manager is responsible for. Component ID of gimbal device (or 1-6 for non-MAVLink gimbal)."]
12623 pub gimbal_device_id: u8,
12624 #[doc = "System ID of MAVLink component with primary control, 0 for none."]
12625 pub primary_control_sysid: u8,
12626 #[doc = "Component ID of MAVLink component with primary control, 0 for none."]
12627 pub primary_control_compid: u8,
12628 #[doc = "System ID of MAVLink component with secondary control, 0 for none."]
12629 pub secondary_control_sysid: u8,
12630 #[doc = "Component ID of MAVLink component with secondary control, 0 for none."]
12631 pub secondary_control_compid: u8,
12632}
12633impl GIMBAL_MANAGER_STATUS_DATA {
12634 pub const ENCODED_LEN: usize = 13usize;
12635 pub const DEFAULT: Self = Self {
12636 time_boot_ms: 0_u32,
12637 flags: GimbalManagerFlags::DEFAULT,
12638 gimbal_device_id: 0_u8,
12639 primary_control_sysid: 0_u8,
12640 primary_control_compid: 0_u8,
12641 secondary_control_sysid: 0_u8,
12642 secondary_control_compid: 0_u8,
12643 };
12644 #[cfg(feature = "arbitrary")]
12645 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12646 use arbitrary::{Arbitrary, Unstructured};
12647 let mut buf = [0u8; 1024];
12648 rng.fill_bytes(&mut buf);
12649 let mut unstructured = Unstructured::new(&buf);
12650 Self::arbitrary(&mut unstructured).unwrap_or_default()
12651 }
12652}
12653impl Default for GIMBAL_MANAGER_STATUS_DATA {
12654 fn default() -> Self {
12655 Self::DEFAULT.clone()
12656 }
12657}
12658impl MessageData for GIMBAL_MANAGER_STATUS_DATA {
12659 type Message = MavMessage;
12660 const ID: u32 = 281u32;
12661 const NAME: &'static str = "GIMBAL_MANAGER_STATUS";
12662 const EXTRA_CRC: u8 = 48u8;
12663 const ENCODED_LEN: usize = 13usize;
12664 fn deser(
12665 _version: MavlinkVersion,
12666 __input: &[u8],
12667 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12668 let avail_len = __input.len();
12669 let mut payload_buf = [0; Self::ENCODED_LEN];
12670 let mut buf = if avail_len < Self::ENCODED_LEN {
12671 payload_buf[0..avail_len].copy_from_slice(__input);
12672 Bytes::new(&payload_buf)
12673 } else {
12674 Bytes::new(__input)
12675 };
12676 let mut __struct = Self::default();
12677 __struct.time_boot_ms = buf.get_u32_le();
12678 let tmp = buf.get_u32_le();
12679 __struct.flags = GimbalManagerFlags::from_bits(tmp & GimbalManagerFlags::all().bits())
12680 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12681 flag_type: "GimbalManagerFlags",
12682 value: tmp as u32,
12683 })?;
12684 __struct.gimbal_device_id = buf.get_u8();
12685 __struct.primary_control_sysid = buf.get_u8();
12686 __struct.primary_control_compid = buf.get_u8();
12687 __struct.secondary_control_sysid = buf.get_u8();
12688 __struct.secondary_control_compid = buf.get_u8();
12689 Ok(__struct)
12690 }
12691 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12692 let mut __tmp = BytesMut::new(bytes);
12693 #[allow(clippy::absurd_extreme_comparisons)]
12694 #[allow(unused_comparisons)]
12695 if __tmp.remaining() < Self::ENCODED_LEN {
12696 panic!(
12697 "buffer is too small (need {} bytes, but got {})",
12698 Self::ENCODED_LEN,
12699 __tmp.remaining(),
12700 )
12701 }
12702 __tmp.put_u32_le(self.time_boot_ms);
12703 __tmp.put_u32_le(self.flags.bits());
12704 __tmp.put_u8(self.gimbal_device_id);
12705 __tmp.put_u8(self.primary_control_sysid);
12706 __tmp.put_u8(self.primary_control_compid);
12707 __tmp.put_u8(self.secondary_control_sysid);
12708 __tmp.put_u8(self.secondary_control_compid);
12709 if matches!(version, MavlinkVersion::V2) {
12710 let len = __tmp.len();
12711 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12712 } else {
12713 __tmp.len()
12714 }
12715 }
12716}
12717#[doc = "id: 33"]
12718#[doc = "The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient."]
12719#[derive(Debug, Clone, PartialEq)]
12720#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12721#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12722pub struct GLOBAL_POSITION_INT_DATA {
12723 #[doc = "Timestamp (time since system boot)."]
12724 pub time_boot_ms: u32,
12725 #[doc = "Latitude, expressed"]
12726 pub lat: i32,
12727 #[doc = "Longitude, expressed"]
12728 pub lon: i32,
12729 #[doc = "Altitude (MSL). Note that virtually all GPS modules provide both WGS84 and MSL."]
12730 pub alt: i32,
12731 #[doc = "Altitude above home"]
12732 pub relative_alt: i32,
12733 #[doc = "Ground X Speed (Latitude, positive north)"]
12734 pub vx: i16,
12735 #[doc = "Ground Y Speed (Longitude, positive east)"]
12736 pub vy: i16,
12737 #[doc = "Ground Z Speed (Altitude, positive down)"]
12738 pub vz: i16,
12739 #[doc = "Vehicle heading (yaw angle), 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
12740 pub hdg: u16,
12741}
12742impl GLOBAL_POSITION_INT_DATA {
12743 pub const ENCODED_LEN: usize = 28usize;
12744 pub const DEFAULT: Self = Self {
12745 time_boot_ms: 0_u32,
12746 lat: 0_i32,
12747 lon: 0_i32,
12748 alt: 0_i32,
12749 relative_alt: 0_i32,
12750 vx: 0_i16,
12751 vy: 0_i16,
12752 vz: 0_i16,
12753 hdg: 0_u16,
12754 };
12755 #[cfg(feature = "arbitrary")]
12756 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12757 use arbitrary::{Arbitrary, Unstructured};
12758 let mut buf = [0u8; 1024];
12759 rng.fill_bytes(&mut buf);
12760 let mut unstructured = Unstructured::new(&buf);
12761 Self::arbitrary(&mut unstructured).unwrap_or_default()
12762 }
12763}
12764impl Default for GLOBAL_POSITION_INT_DATA {
12765 fn default() -> Self {
12766 Self::DEFAULT.clone()
12767 }
12768}
12769impl MessageData for GLOBAL_POSITION_INT_DATA {
12770 type Message = MavMessage;
12771 const ID: u32 = 33u32;
12772 const NAME: &'static str = "GLOBAL_POSITION_INT";
12773 const EXTRA_CRC: u8 = 104u8;
12774 const ENCODED_LEN: usize = 28usize;
12775 fn deser(
12776 _version: MavlinkVersion,
12777 __input: &[u8],
12778 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12779 let avail_len = __input.len();
12780 let mut payload_buf = [0; Self::ENCODED_LEN];
12781 let mut buf = if avail_len < Self::ENCODED_LEN {
12782 payload_buf[0..avail_len].copy_from_slice(__input);
12783 Bytes::new(&payload_buf)
12784 } else {
12785 Bytes::new(__input)
12786 };
12787 let mut __struct = Self::default();
12788 __struct.time_boot_ms = buf.get_u32_le();
12789 __struct.lat = buf.get_i32_le();
12790 __struct.lon = buf.get_i32_le();
12791 __struct.alt = buf.get_i32_le();
12792 __struct.relative_alt = buf.get_i32_le();
12793 __struct.vx = buf.get_i16_le();
12794 __struct.vy = buf.get_i16_le();
12795 __struct.vz = buf.get_i16_le();
12796 __struct.hdg = buf.get_u16_le();
12797 Ok(__struct)
12798 }
12799 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12800 let mut __tmp = BytesMut::new(bytes);
12801 #[allow(clippy::absurd_extreme_comparisons)]
12802 #[allow(unused_comparisons)]
12803 if __tmp.remaining() < Self::ENCODED_LEN {
12804 panic!(
12805 "buffer is too small (need {} bytes, but got {})",
12806 Self::ENCODED_LEN,
12807 __tmp.remaining(),
12808 )
12809 }
12810 __tmp.put_u32_le(self.time_boot_ms);
12811 __tmp.put_i32_le(self.lat);
12812 __tmp.put_i32_le(self.lon);
12813 __tmp.put_i32_le(self.alt);
12814 __tmp.put_i32_le(self.relative_alt);
12815 __tmp.put_i16_le(self.vx);
12816 __tmp.put_i16_le(self.vy);
12817 __tmp.put_i16_le(self.vz);
12818 __tmp.put_u16_le(self.hdg);
12819 if matches!(version, MavlinkVersion::V2) {
12820 let len = __tmp.len();
12821 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12822 } else {
12823 __tmp.len()
12824 }
12825 }
12826}
12827#[doc = "id: 63"]
12828#[doc = "The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient. NOTE: This message is intended for onboard networks / companion computers and higher-bandwidth links and optimized for accuracy and completeness. Please use the GLOBAL_POSITION_INT message for a minimal subset."]
12829#[derive(Debug, Clone, PartialEq)]
12830#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12831#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12832pub struct GLOBAL_POSITION_INT_COV_DATA {
12833 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
12834 pub time_usec: u64,
12835 #[doc = "Latitude"]
12836 pub lat: i32,
12837 #[doc = "Longitude"]
12838 pub lon: i32,
12839 #[doc = "Altitude in meters above MSL"]
12840 pub alt: i32,
12841 #[doc = "Altitude above ground"]
12842 pub relative_alt: i32,
12843 #[doc = "Ground X Speed (Latitude)"]
12844 pub vx: f32,
12845 #[doc = "Ground Y Speed (Longitude)"]
12846 pub vy: f32,
12847 #[doc = "Ground Z Speed (Altitude)"]
12848 pub vz: f32,
12849 #[doc = "Row-major representation of a 6x6 position and velocity 6x6 cross-covariance matrix (states: lat, lon, alt, vx, vy, vz; first six entries are the first ROW, next six entries are the second row, etc.). If unknown, assign NaN value to first element in the array."]
12850 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12851 pub covariance: [f32; 36],
12852 #[doc = "Class id of the estimator this estimate originated from."]
12853 pub estimator_type: MavEstimatorType,
12854}
12855impl GLOBAL_POSITION_INT_COV_DATA {
12856 pub const ENCODED_LEN: usize = 181usize;
12857 pub const DEFAULT: Self = Self {
12858 time_usec: 0_u64,
12859 lat: 0_i32,
12860 lon: 0_i32,
12861 alt: 0_i32,
12862 relative_alt: 0_i32,
12863 vx: 0.0_f32,
12864 vy: 0.0_f32,
12865 vz: 0.0_f32,
12866 covariance: [0.0_f32; 36usize],
12867 estimator_type: MavEstimatorType::DEFAULT,
12868 };
12869 #[cfg(feature = "arbitrary")]
12870 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12871 use arbitrary::{Arbitrary, Unstructured};
12872 let mut buf = [0u8; 1024];
12873 rng.fill_bytes(&mut buf);
12874 let mut unstructured = Unstructured::new(&buf);
12875 Self::arbitrary(&mut unstructured).unwrap_or_default()
12876 }
12877}
12878impl Default for GLOBAL_POSITION_INT_COV_DATA {
12879 fn default() -> Self {
12880 Self::DEFAULT.clone()
12881 }
12882}
12883impl MessageData for GLOBAL_POSITION_INT_COV_DATA {
12884 type Message = MavMessage;
12885 const ID: u32 = 63u32;
12886 const NAME: &'static str = "GLOBAL_POSITION_INT_COV";
12887 const EXTRA_CRC: u8 = 119u8;
12888 const ENCODED_LEN: usize = 181usize;
12889 fn deser(
12890 _version: MavlinkVersion,
12891 __input: &[u8],
12892 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12893 let avail_len = __input.len();
12894 let mut payload_buf = [0; Self::ENCODED_LEN];
12895 let mut buf = if avail_len < Self::ENCODED_LEN {
12896 payload_buf[0..avail_len].copy_from_slice(__input);
12897 Bytes::new(&payload_buf)
12898 } else {
12899 Bytes::new(__input)
12900 };
12901 let mut __struct = Self::default();
12902 __struct.time_usec = buf.get_u64_le();
12903 __struct.lat = buf.get_i32_le();
12904 __struct.lon = buf.get_i32_le();
12905 __struct.alt = buf.get_i32_le();
12906 __struct.relative_alt = buf.get_i32_le();
12907 __struct.vx = buf.get_f32_le();
12908 __struct.vy = buf.get_f32_le();
12909 __struct.vz = buf.get_f32_le();
12910 for v in &mut __struct.covariance {
12911 let val = buf.get_f32_le();
12912 *v = val;
12913 }
12914 let tmp = buf.get_u8();
12915 __struct.estimator_type =
12916 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
12917 enum_type: "MavEstimatorType",
12918 value: tmp as u32,
12919 })?;
12920 Ok(__struct)
12921 }
12922 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12923 let mut __tmp = BytesMut::new(bytes);
12924 #[allow(clippy::absurd_extreme_comparisons)]
12925 #[allow(unused_comparisons)]
12926 if __tmp.remaining() < Self::ENCODED_LEN {
12927 panic!(
12928 "buffer is too small (need {} bytes, but got {})",
12929 Self::ENCODED_LEN,
12930 __tmp.remaining(),
12931 )
12932 }
12933 __tmp.put_u64_le(self.time_usec);
12934 __tmp.put_i32_le(self.lat);
12935 __tmp.put_i32_le(self.lon);
12936 __tmp.put_i32_le(self.alt);
12937 __tmp.put_i32_le(self.relative_alt);
12938 __tmp.put_f32_le(self.vx);
12939 __tmp.put_f32_le(self.vy);
12940 __tmp.put_f32_le(self.vz);
12941 for val in &self.covariance {
12942 __tmp.put_f32_le(*val);
12943 }
12944 __tmp.put_u8(self.estimator_type as u8);
12945 if matches!(version, MavlinkVersion::V2) {
12946 let len = __tmp.len();
12947 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12948 } else {
12949 __tmp.len()
12950 }
12951 }
12952}
12953#[doc = "id: 101"]
12954#[doc = "Global position/attitude estimate from a vision source."]
12955#[derive(Debug, Clone, PartialEq)]
12956#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12957#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12958pub struct GLOBAL_VISION_POSITION_ESTIMATE_DATA {
12959 #[doc = "Timestamp (UNIX time or since system boot)"]
12960 pub usec: u64,
12961 #[doc = "Global X position"]
12962 pub x: f32,
12963 #[doc = "Global Y position"]
12964 pub y: f32,
12965 #[doc = "Global Z position"]
12966 pub z: f32,
12967 #[doc = "Roll angle"]
12968 pub roll: f32,
12969 #[doc = "Pitch angle"]
12970 pub pitch: f32,
12971 #[doc = "Yaw angle"]
12972 pub yaw: f32,
12973 #[doc = "Row-major representation of pose 6x6 cross-covariance matrix upper right triangle (states: x_global, y_global, z_global, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
12974 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
12975 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12976 pub covariance: [f32; 21],
12977 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
12978 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
12979 pub reset_counter: u8,
12980}
12981impl GLOBAL_VISION_POSITION_ESTIMATE_DATA {
12982 pub const ENCODED_LEN: usize = 117usize;
12983 pub const DEFAULT: Self = Self {
12984 usec: 0_u64,
12985 x: 0.0_f32,
12986 y: 0.0_f32,
12987 z: 0.0_f32,
12988 roll: 0.0_f32,
12989 pitch: 0.0_f32,
12990 yaw: 0.0_f32,
12991 covariance: [0.0_f32; 21usize],
12992 reset_counter: 0_u8,
12993 };
12994 #[cfg(feature = "arbitrary")]
12995 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12996 use arbitrary::{Arbitrary, Unstructured};
12997 let mut buf = [0u8; 1024];
12998 rng.fill_bytes(&mut buf);
12999 let mut unstructured = Unstructured::new(&buf);
13000 Self::arbitrary(&mut unstructured).unwrap_or_default()
13001 }
13002}
13003impl Default for GLOBAL_VISION_POSITION_ESTIMATE_DATA {
13004 fn default() -> Self {
13005 Self::DEFAULT.clone()
13006 }
13007}
13008impl MessageData for GLOBAL_VISION_POSITION_ESTIMATE_DATA {
13009 type Message = MavMessage;
13010 const ID: u32 = 101u32;
13011 const NAME: &'static str = "GLOBAL_VISION_POSITION_ESTIMATE";
13012 const EXTRA_CRC: u8 = 102u8;
13013 const ENCODED_LEN: usize = 117usize;
13014 fn deser(
13015 _version: MavlinkVersion,
13016 __input: &[u8],
13017 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13018 let avail_len = __input.len();
13019 let mut payload_buf = [0; Self::ENCODED_LEN];
13020 let mut buf = if avail_len < Self::ENCODED_LEN {
13021 payload_buf[0..avail_len].copy_from_slice(__input);
13022 Bytes::new(&payload_buf)
13023 } else {
13024 Bytes::new(__input)
13025 };
13026 let mut __struct = Self::default();
13027 __struct.usec = buf.get_u64_le();
13028 __struct.x = buf.get_f32_le();
13029 __struct.y = buf.get_f32_le();
13030 __struct.z = buf.get_f32_le();
13031 __struct.roll = buf.get_f32_le();
13032 __struct.pitch = buf.get_f32_le();
13033 __struct.yaw = buf.get_f32_le();
13034 for v in &mut __struct.covariance {
13035 let val = buf.get_f32_le();
13036 *v = val;
13037 }
13038 __struct.reset_counter = buf.get_u8();
13039 Ok(__struct)
13040 }
13041 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13042 let mut __tmp = BytesMut::new(bytes);
13043 #[allow(clippy::absurd_extreme_comparisons)]
13044 #[allow(unused_comparisons)]
13045 if __tmp.remaining() < Self::ENCODED_LEN {
13046 panic!(
13047 "buffer is too small (need {} bytes, but got {})",
13048 Self::ENCODED_LEN,
13049 __tmp.remaining(),
13050 )
13051 }
13052 __tmp.put_u64_le(self.usec);
13053 __tmp.put_f32_le(self.x);
13054 __tmp.put_f32_le(self.y);
13055 __tmp.put_f32_le(self.z);
13056 __tmp.put_f32_le(self.roll);
13057 __tmp.put_f32_le(self.pitch);
13058 __tmp.put_f32_le(self.yaw);
13059 for val in &self.covariance {
13060 __tmp.put_f32_le(*val);
13061 }
13062 __tmp.put_u8(self.reset_counter);
13063 if matches!(version, MavlinkVersion::V2) {
13064 let len = __tmp.len();
13065 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13066 } else {
13067 __tmp.len()
13068 }
13069 }
13070}
13071#[doc = "id: 124"]
13072#[doc = "Second GPS data."]
13073#[derive(Debug, Clone, PartialEq)]
13074#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13075#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13076pub struct GPS2_RAW_DATA {
13077 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
13078 pub time_usec: u64,
13079 #[doc = "Latitude (WGS84)"]
13080 pub lat: i32,
13081 #[doc = "Longitude (WGS84)"]
13082 pub lon: i32,
13083 #[doc = "Altitude (MSL). Positive for up."]
13084 pub alt: i32,
13085 #[doc = "Age of DGPS info"]
13086 pub dgps_age: u32,
13087 #[doc = "GPS HDOP horizontal dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
13088 pub eph: u16,
13089 #[doc = "GPS VDOP vertical dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
13090 pub epv: u16,
13091 #[doc = "GPS ground speed. If unknown, set to: UINT16_MAX"]
13092 pub vel: u16,
13093 #[doc = "Course over ground (NOT heading, but direction of movement): 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
13094 pub cog: u16,
13095 #[doc = "GPS fix type."]
13096 pub fix_type: GpsFixType,
13097 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
13098 pub satellites_visible: u8,
13099 #[doc = "Number of DGPS satellites"]
13100 pub dgps_numch: u8,
13101 #[doc = "Yaw in earth frame from north. Use 0 if this GPS does not provide yaw. Use UINT16_MAX if this GPS is configured to provide yaw and is currently unable to provide it. Use 36000 for north."]
13102 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13103 pub yaw: u16,
13104 #[doc = "Altitude (above WGS84, EGM96 ellipsoid). Positive for up."]
13105 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13106 pub alt_ellipsoid: i32,
13107 #[doc = "Position uncertainty."]
13108 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13109 pub h_acc: u32,
13110 #[doc = "Altitude uncertainty."]
13111 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13112 pub v_acc: u32,
13113 #[doc = "Speed uncertainty."]
13114 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13115 pub vel_acc: u32,
13116 #[doc = "Heading / track uncertainty"]
13117 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13118 pub hdg_acc: u32,
13119}
13120impl GPS2_RAW_DATA {
13121 pub const ENCODED_LEN: usize = 57usize;
13122 pub const DEFAULT: Self = Self {
13123 time_usec: 0_u64,
13124 lat: 0_i32,
13125 lon: 0_i32,
13126 alt: 0_i32,
13127 dgps_age: 0_u32,
13128 eph: 0_u16,
13129 epv: 0_u16,
13130 vel: 0_u16,
13131 cog: 0_u16,
13132 fix_type: GpsFixType::DEFAULT,
13133 satellites_visible: 0_u8,
13134 dgps_numch: 0_u8,
13135 yaw: 0_u16,
13136 alt_ellipsoid: 0_i32,
13137 h_acc: 0_u32,
13138 v_acc: 0_u32,
13139 vel_acc: 0_u32,
13140 hdg_acc: 0_u32,
13141 };
13142 #[cfg(feature = "arbitrary")]
13143 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13144 use arbitrary::{Arbitrary, Unstructured};
13145 let mut buf = [0u8; 1024];
13146 rng.fill_bytes(&mut buf);
13147 let mut unstructured = Unstructured::new(&buf);
13148 Self::arbitrary(&mut unstructured).unwrap_or_default()
13149 }
13150}
13151impl Default for GPS2_RAW_DATA {
13152 fn default() -> Self {
13153 Self::DEFAULT.clone()
13154 }
13155}
13156impl MessageData for GPS2_RAW_DATA {
13157 type Message = MavMessage;
13158 const ID: u32 = 124u32;
13159 const NAME: &'static str = "GPS2_RAW";
13160 const EXTRA_CRC: u8 = 87u8;
13161 const ENCODED_LEN: usize = 57usize;
13162 fn deser(
13163 _version: MavlinkVersion,
13164 __input: &[u8],
13165 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13166 let avail_len = __input.len();
13167 let mut payload_buf = [0; Self::ENCODED_LEN];
13168 let mut buf = if avail_len < Self::ENCODED_LEN {
13169 payload_buf[0..avail_len].copy_from_slice(__input);
13170 Bytes::new(&payload_buf)
13171 } else {
13172 Bytes::new(__input)
13173 };
13174 let mut __struct = Self::default();
13175 __struct.time_usec = buf.get_u64_le();
13176 __struct.lat = buf.get_i32_le();
13177 __struct.lon = buf.get_i32_le();
13178 __struct.alt = buf.get_i32_le();
13179 __struct.dgps_age = buf.get_u32_le();
13180 __struct.eph = buf.get_u16_le();
13181 __struct.epv = buf.get_u16_le();
13182 __struct.vel = buf.get_u16_le();
13183 __struct.cog = buf.get_u16_le();
13184 let tmp = buf.get_u8();
13185 __struct.fix_type =
13186 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
13187 enum_type: "GpsFixType",
13188 value: tmp as u32,
13189 })?;
13190 __struct.satellites_visible = buf.get_u8();
13191 __struct.dgps_numch = buf.get_u8();
13192 __struct.yaw = buf.get_u16_le();
13193 __struct.alt_ellipsoid = buf.get_i32_le();
13194 __struct.h_acc = buf.get_u32_le();
13195 __struct.v_acc = buf.get_u32_le();
13196 __struct.vel_acc = buf.get_u32_le();
13197 __struct.hdg_acc = buf.get_u32_le();
13198 Ok(__struct)
13199 }
13200 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13201 let mut __tmp = BytesMut::new(bytes);
13202 #[allow(clippy::absurd_extreme_comparisons)]
13203 #[allow(unused_comparisons)]
13204 if __tmp.remaining() < Self::ENCODED_LEN {
13205 panic!(
13206 "buffer is too small (need {} bytes, but got {})",
13207 Self::ENCODED_LEN,
13208 __tmp.remaining(),
13209 )
13210 }
13211 __tmp.put_u64_le(self.time_usec);
13212 __tmp.put_i32_le(self.lat);
13213 __tmp.put_i32_le(self.lon);
13214 __tmp.put_i32_le(self.alt);
13215 __tmp.put_u32_le(self.dgps_age);
13216 __tmp.put_u16_le(self.eph);
13217 __tmp.put_u16_le(self.epv);
13218 __tmp.put_u16_le(self.vel);
13219 __tmp.put_u16_le(self.cog);
13220 __tmp.put_u8(self.fix_type as u8);
13221 __tmp.put_u8(self.satellites_visible);
13222 __tmp.put_u8(self.dgps_numch);
13223 __tmp.put_u16_le(self.yaw);
13224 __tmp.put_i32_le(self.alt_ellipsoid);
13225 __tmp.put_u32_le(self.h_acc);
13226 __tmp.put_u32_le(self.v_acc);
13227 __tmp.put_u32_le(self.vel_acc);
13228 __tmp.put_u32_le(self.hdg_acc);
13229 if matches!(version, MavlinkVersion::V2) {
13230 let len = __tmp.len();
13231 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13232 } else {
13233 __tmp.len()
13234 }
13235 }
13236}
13237#[doc = "id: 128"]
13238#[doc = "RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting."]
13239#[derive(Debug, Clone, PartialEq)]
13240#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13241#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13242pub struct GPS2_RTK_DATA {
13243 #[doc = "Time since boot of last baseline message received."]
13244 pub time_last_baseline_ms: u32,
13245 #[doc = "GPS Time of Week of last baseline"]
13246 pub tow: u32,
13247 #[doc = "Current baseline in ECEF x or NED north component."]
13248 pub baseline_a_mm: i32,
13249 #[doc = "Current baseline in ECEF y or NED east component."]
13250 pub baseline_b_mm: i32,
13251 #[doc = "Current baseline in ECEF z or NED down component."]
13252 pub baseline_c_mm: i32,
13253 #[doc = "Current estimate of baseline accuracy."]
13254 pub accuracy: u32,
13255 #[doc = "Current number of integer ambiguity hypotheses."]
13256 pub iar_num_hypotheses: i32,
13257 #[doc = "GPS Week Number of last baseline"]
13258 pub wn: u16,
13259 #[doc = "Identification of connected RTK receiver."]
13260 pub rtk_receiver_id: u8,
13261 #[doc = "GPS-specific health report for RTK data."]
13262 pub rtk_health: u8,
13263 #[doc = "Rate of baseline messages being received by GPS"]
13264 pub rtk_rate: u8,
13265 #[doc = "Current number of sats used for RTK calculation."]
13266 pub nsats: u8,
13267 #[doc = "Coordinate system of baseline"]
13268 pub baseline_coords_type: RtkBaselineCoordinateSystem,
13269}
13270impl GPS2_RTK_DATA {
13271 pub const ENCODED_LEN: usize = 35usize;
13272 pub const DEFAULT: Self = Self {
13273 time_last_baseline_ms: 0_u32,
13274 tow: 0_u32,
13275 baseline_a_mm: 0_i32,
13276 baseline_b_mm: 0_i32,
13277 baseline_c_mm: 0_i32,
13278 accuracy: 0_u32,
13279 iar_num_hypotheses: 0_i32,
13280 wn: 0_u16,
13281 rtk_receiver_id: 0_u8,
13282 rtk_health: 0_u8,
13283 rtk_rate: 0_u8,
13284 nsats: 0_u8,
13285 baseline_coords_type: RtkBaselineCoordinateSystem::DEFAULT,
13286 };
13287 #[cfg(feature = "arbitrary")]
13288 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13289 use arbitrary::{Arbitrary, Unstructured};
13290 let mut buf = [0u8; 1024];
13291 rng.fill_bytes(&mut buf);
13292 let mut unstructured = Unstructured::new(&buf);
13293 Self::arbitrary(&mut unstructured).unwrap_or_default()
13294 }
13295}
13296impl Default for GPS2_RTK_DATA {
13297 fn default() -> Self {
13298 Self::DEFAULT.clone()
13299 }
13300}
13301impl MessageData for GPS2_RTK_DATA {
13302 type Message = MavMessage;
13303 const ID: u32 = 128u32;
13304 const NAME: &'static str = "GPS2_RTK";
13305 const EXTRA_CRC: u8 = 226u8;
13306 const ENCODED_LEN: usize = 35usize;
13307 fn deser(
13308 _version: MavlinkVersion,
13309 __input: &[u8],
13310 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13311 let avail_len = __input.len();
13312 let mut payload_buf = [0; Self::ENCODED_LEN];
13313 let mut buf = if avail_len < Self::ENCODED_LEN {
13314 payload_buf[0..avail_len].copy_from_slice(__input);
13315 Bytes::new(&payload_buf)
13316 } else {
13317 Bytes::new(__input)
13318 };
13319 let mut __struct = Self::default();
13320 __struct.time_last_baseline_ms = buf.get_u32_le();
13321 __struct.tow = buf.get_u32_le();
13322 __struct.baseline_a_mm = buf.get_i32_le();
13323 __struct.baseline_b_mm = buf.get_i32_le();
13324 __struct.baseline_c_mm = buf.get_i32_le();
13325 __struct.accuracy = buf.get_u32_le();
13326 __struct.iar_num_hypotheses = buf.get_i32_le();
13327 __struct.wn = buf.get_u16_le();
13328 __struct.rtk_receiver_id = buf.get_u8();
13329 __struct.rtk_health = buf.get_u8();
13330 __struct.rtk_rate = buf.get_u8();
13331 __struct.nsats = buf.get_u8();
13332 let tmp = buf.get_u8();
13333 __struct.baseline_coords_type =
13334 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
13335 enum_type: "RtkBaselineCoordinateSystem",
13336 value: tmp as u32,
13337 })?;
13338 Ok(__struct)
13339 }
13340 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13341 let mut __tmp = BytesMut::new(bytes);
13342 #[allow(clippy::absurd_extreme_comparisons)]
13343 #[allow(unused_comparisons)]
13344 if __tmp.remaining() < Self::ENCODED_LEN {
13345 panic!(
13346 "buffer is too small (need {} bytes, but got {})",
13347 Self::ENCODED_LEN,
13348 __tmp.remaining(),
13349 )
13350 }
13351 __tmp.put_u32_le(self.time_last_baseline_ms);
13352 __tmp.put_u32_le(self.tow);
13353 __tmp.put_i32_le(self.baseline_a_mm);
13354 __tmp.put_i32_le(self.baseline_b_mm);
13355 __tmp.put_i32_le(self.baseline_c_mm);
13356 __tmp.put_u32_le(self.accuracy);
13357 __tmp.put_i32_le(self.iar_num_hypotheses);
13358 __tmp.put_u16_le(self.wn);
13359 __tmp.put_u8(self.rtk_receiver_id);
13360 __tmp.put_u8(self.rtk_health);
13361 __tmp.put_u8(self.rtk_rate);
13362 __tmp.put_u8(self.nsats);
13363 __tmp.put_u8(self.baseline_coords_type as u8);
13364 if matches!(version, MavlinkVersion::V2) {
13365 let len = __tmp.len();
13366 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13367 } else {
13368 __tmp.len()
13369 }
13370 }
13371}
13372#[doc = "id: 49"]
13373#[doc = "Publishes the GPS coordinates of the vehicle local origin (0,0,0) position. Emitted whenever a new GPS-Local position mapping is requested or set - e.g. following SET_GPS_GLOBAL_ORIGIN message."]
13374#[derive(Debug, Clone, PartialEq)]
13375#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13376#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13377pub struct GPS_GLOBAL_ORIGIN_DATA {
13378 #[doc = "Latitude (WGS84)"]
13379 pub latitude: i32,
13380 #[doc = "Longitude (WGS84)"]
13381 pub longitude: i32,
13382 #[doc = "Altitude (MSL). Positive for up."]
13383 pub altitude: i32,
13384 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
13385 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13386 pub time_usec: u64,
13387}
13388impl GPS_GLOBAL_ORIGIN_DATA {
13389 pub const ENCODED_LEN: usize = 20usize;
13390 pub const DEFAULT: Self = Self {
13391 latitude: 0_i32,
13392 longitude: 0_i32,
13393 altitude: 0_i32,
13394 time_usec: 0_u64,
13395 };
13396 #[cfg(feature = "arbitrary")]
13397 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13398 use arbitrary::{Arbitrary, Unstructured};
13399 let mut buf = [0u8; 1024];
13400 rng.fill_bytes(&mut buf);
13401 let mut unstructured = Unstructured::new(&buf);
13402 Self::arbitrary(&mut unstructured).unwrap_or_default()
13403 }
13404}
13405impl Default for GPS_GLOBAL_ORIGIN_DATA {
13406 fn default() -> Self {
13407 Self::DEFAULT.clone()
13408 }
13409}
13410impl MessageData for GPS_GLOBAL_ORIGIN_DATA {
13411 type Message = MavMessage;
13412 const ID: u32 = 49u32;
13413 const NAME: &'static str = "GPS_GLOBAL_ORIGIN";
13414 const EXTRA_CRC: u8 = 39u8;
13415 const ENCODED_LEN: usize = 20usize;
13416 fn deser(
13417 _version: MavlinkVersion,
13418 __input: &[u8],
13419 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13420 let avail_len = __input.len();
13421 let mut payload_buf = [0; Self::ENCODED_LEN];
13422 let mut buf = if avail_len < Self::ENCODED_LEN {
13423 payload_buf[0..avail_len].copy_from_slice(__input);
13424 Bytes::new(&payload_buf)
13425 } else {
13426 Bytes::new(__input)
13427 };
13428 let mut __struct = Self::default();
13429 __struct.latitude = buf.get_i32_le();
13430 __struct.longitude = buf.get_i32_le();
13431 __struct.altitude = buf.get_i32_le();
13432 __struct.time_usec = buf.get_u64_le();
13433 Ok(__struct)
13434 }
13435 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13436 let mut __tmp = BytesMut::new(bytes);
13437 #[allow(clippy::absurd_extreme_comparisons)]
13438 #[allow(unused_comparisons)]
13439 if __tmp.remaining() < Self::ENCODED_LEN {
13440 panic!(
13441 "buffer is too small (need {} bytes, but got {})",
13442 Self::ENCODED_LEN,
13443 __tmp.remaining(),
13444 )
13445 }
13446 __tmp.put_i32_le(self.latitude);
13447 __tmp.put_i32_le(self.longitude);
13448 __tmp.put_i32_le(self.altitude);
13449 __tmp.put_u64_le(self.time_usec);
13450 if matches!(version, MavlinkVersion::V2) {
13451 let len = __tmp.len();
13452 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13453 } else {
13454 __tmp.len()
13455 }
13456 }
13457}
13458#[deprecated = " See `GPS_RTCM_DATA` (Deprecated since 2022-05)"]
13459#[doc = "id: 123"]
13460#[doc = "Data for injecting into the onboard GPS (used for DGPS)."]
13461#[derive(Debug, Clone, PartialEq)]
13462#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13463#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13464pub struct GPS_INJECT_DATA_DATA {
13465 #[doc = "System ID"]
13466 pub target_system: u8,
13467 #[doc = "Component ID"]
13468 pub target_component: u8,
13469 #[doc = "Data length"]
13470 pub len: u8,
13471 #[doc = "Raw data (110 is enough for 12 satellites of RTCMv2)"]
13472 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
13473 pub data: [u8; 110],
13474}
13475impl GPS_INJECT_DATA_DATA {
13476 pub const ENCODED_LEN: usize = 113usize;
13477 pub const DEFAULT: Self = Self {
13478 target_system: 0_u8,
13479 target_component: 0_u8,
13480 len: 0_u8,
13481 data: [0_u8; 110usize],
13482 };
13483 #[cfg(feature = "arbitrary")]
13484 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13485 use arbitrary::{Arbitrary, Unstructured};
13486 let mut buf = [0u8; 1024];
13487 rng.fill_bytes(&mut buf);
13488 let mut unstructured = Unstructured::new(&buf);
13489 Self::arbitrary(&mut unstructured).unwrap_or_default()
13490 }
13491}
13492impl Default for GPS_INJECT_DATA_DATA {
13493 fn default() -> Self {
13494 Self::DEFAULT.clone()
13495 }
13496}
13497impl MessageData for GPS_INJECT_DATA_DATA {
13498 type Message = MavMessage;
13499 const ID: u32 = 123u32;
13500 const NAME: &'static str = "GPS_INJECT_DATA";
13501 const EXTRA_CRC: u8 = 250u8;
13502 const ENCODED_LEN: usize = 113usize;
13503 fn deser(
13504 _version: MavlinkVersion,
13505 __input: &[u8],
13506 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13507 let avail_len = __input.len();
13508 let mut payload_buf = [0; Self::ENCODED_LEN];
13509 let mut buf = if avail_len < Self::ENCODED_LEN {
13510 payload_buf[0..avail_len].copy_from_slice(__input);
13511 Bytes::new(&payload_buf)
13512 } else {
13513 Bytes::new(__input)
13514 };
13515 let mut __struct = Self::default();
13516 __struct.target_system = buf.get_u8();
13517 __struct.target_component = buf.get_u8();
13518 __struct.len = buf.get_u8();
13519 for v in &mut __struct.data {
13520 let val = buf.get_u8();
13521 *v = val;
13522 }
13523 Ok(__struct)
13524 }
13525 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13526 let mut __tmp = BytesMut::new(bytes);
13527 #[allow(clippy::absurd_extreme_comparisons)]
13528 #[allow(unused_comparisons)]
13529 if __tmp.remaining() < Self::ENCODED_LEN {
13530 panic!(
13531 "buffer is too small (need {} bytes, but got {})",
13532 Self::ENCODED_LEN,
13533 __tmp.remaining(),
13534 )
13535 }
13536 __tmp.put_u8(self.target_system);
13537 __tmp.put_u8(self.target_component);
13538 __tmp.put_u8(self.len);
13539 for val in &self.data {
13540 __tmp.put_u8(*val);
13541 }
13542 if matches!(version, MavlinkVersion::V2) {
13543 let len = __tmp.len();
13544 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13545 } else {
13546 __tmp.len()
13547 }
13548 }
13549}
13550#[doc = "id: 232"]
13551#[doc = "GPS sensor input message. This is a raw sensor value sent by the GPS. This is NOT the global position estimate of the system."]
13552#[derive(Debug, Clone, PartialEq)]
13553#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13554#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13555pub struct GPS_INPUT_DATA {
13556 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
13557 pub time_usec: u64,
13558 #[doc = "GPS time (from start of GPS week)"]
13559 pub time_week_ms: u32,
13560 #[doc = "Latitude (WGS84)"]
13561 pub lat: i32,
13562 #[doc = "Longitude (WGS84)"]
13563 pub lon: i32,
13564 #[doc = "Altitude (MSL). Positive for up."]
13565 pub alt: f32,
13566 #[doc = "GPS HDOP horizontal dilution of position (unitless). If unknown, set to: UINT16_MAX"]
13567 pub hdop: f32,
13568 #[doc = "GPS VDOP vertical dilution of position (unitless). If unknown, set to: UINT16_MAX"]
13569 pub vdop: f32,
13570 #[doc = "GPS velocity in north direction in earth-fixed NED frame"]
13571 pub vn: f32,
13572 #[doc = "GPS velocity in east direction in earth-fixed NED frame"]
13573 pub ve: f32,
13574 #[doc = "GPS velocity in down direction in earth-fixed NED frame"]
13575 pub vd: f32,
13576 #[doc = "GPS speed accuracy"]
13577 pub speed_accuracy: f32,
13578 #[doc = "GPS horizontal accuracy"]
13579 pub horiz_accuracy: f32,
13580 #[doc = "GPS vertical accuracy"]
13581 pub vert_accuracy: f32,
13582 #[doc = "Bitmap indicating which GPS input flags fields to ignore. All other fields must be provided."]
13583 pub ignore_flags: GpsInputIgnoreFlags,
13584 #[doc = "GPS week number"]
13585 pub time_week: u16,
13586 #[doc = "ID of the GPS for multiple GPS inputs"]
13587 pub gps_id: u8,
13588 #[doc = "0-1: no fix, 2: 2D fix, 3: 3D fix. 4: 3D with DGPS. 5: 3D with RTK"]
13589 pub fix_type: u8,
13590 #[doc = "Number of satellites visible."]
13591 pub satellites_visible: u8,
13592 #[doc = "Yaw of vehicle relative to Earth's North, zero means not available, use 36000 for north"]
13593 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13594 pub yaw: u16,
13595}
13596impl GPS_INPUT_DATA {
13597 pub const ENCODED_LEN: usize = 65usize;
13598 pub const DEFAULT: Self = Self {
13599 time_usec: 0_u64,
13600 time_week_ms: 0_u32,
13601 lat: 0_i32,
13602 lon: 0_i32,
13603 alt: 0.0_f32,
13604 hdop: 0.0_f32,
13605 vdop: 0.0_f32,
13606 vn: 0.0_f32,
13607 ve: 0.0_f32,
13608 vd: 0.0_f32,
13609 speed_accuracy: 0.0_f32,
13610 horiz_accuracy: 0.0_f32,
13611 vert_accuracy: 0.0_f32,
13612 ignore_flags: GpsInputIgnoreFlags::DEFAULT,
13613 time_week: 0_u16,
13614 gps_id: 0_u8,
13615 fix_type: 0_u8,
13616 satellites_visible: 0_u8,
13617 yaw: 0_u16,
13618 };
13619 #[cfg(feature = "arbitrary")]
13620 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13621 use arbitrary::{Arbitrary, Unstructured};
13622 let mut buf = [0u8; 1024];
13623 rng.fill_bytes(&mut buf);
13624 let mut unstructured = Unstructured::new(&buf);
13625 Self::arbitrary(&mut unstructured).unwrap_or_default()
13626 }
13627}
13628impl Default for GPS_INPUT_DATA {
13629 fn default() -> Self {
13630 Self::DEFAULT.clone()
13631 }
13632}
13633impl MessageData for GPS_INPUT_DATA {
13634 type Message = MavMessage;
13635 const ID: u32 = 232u32;
13636 const NAME: &'static str = "GPS_INPUT";
13637 const EXTRA_CRC: u8 = 151u8;
13638 const ENCODED_LEN: usize = 65usize;
13639 fn deser(
13640 _version: MavlinkVersion,
13641 __input: &[u8],
13642 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13643 let avail_len = __input.len();
13644 let mut payload_buf = [0; Self::ENCODED_LEN];
13645 let mut buf = if avail_len < Self::ENCODED_LEN {
13646 payload_buf[0..avail_len].copy_from_slice(__input);
13647 Bytes::new(&payload_buf)
13648 } else {
13649 Bytes::new(__input)
13650 };
13651 let mut __struct = Self::default();
13652 __struct.time_usec = buf.get_u64_le();
13653 __struct.time_week_ms = buf.get_u32_le();
13654 __struct.lat = buf.get_i32_le();
13655 __struct.lon = buf.get_i32_le();
13656 __struct.alt = buf.get_f32_le();
13657 __struct.hdop = buf.get_f32_le();
13658 __struct.vdop = buf.get_f32_le();
13659 __struct.vn = buf.get_f32_le();
13660 __struct.ve = buf.get_f32_le();
13661 __struct.vd = buf.get_f32_le();
13662 __struct.speed_accuracy = buf.get_f32_le();
13663 __struct.horiz_accuracy = buf.get_f32_le();
13664 __struct.vert_accuracy = buf.get_f32_le();
13665 let tmp = buf.get_u16_le();
13666 __struct.ignore_flags = GpsInputIgnoreFlags::from_bits(
13667 tmp & GpsInputIgnoreFlags::all().bits(),
13668 )
13669 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
13670 flag_type: "GpsInputIgnoreFlags",
13671 value: tmp as u32,
13672 })?;
13673 __struct.time_week = buf.get_u16_le();
13674 __struct.gps_id = buf.get_u8();
13675 __struct.fix_type = buf.get_u8();
13676 __struct.satellites_visible = buf.get_u8();
13677 __struct.yaw = buf.get_u16_le();
13678 Ok(__struct)
13679 }
13680 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13681 let mut __tmp = BytesMut::new(bytes);
13682 #[allow(clippy::absurd_extreme_comparisons)]
13683 #[allow(unused_comparisons)]
13684 if __tmp.remaining() < Self::ENCODED_LEN {
13685 panic!(
13686 "buffer is too small (need {} bytes, but got {})",
13687 Self::ENCODED_LEN,
13688 __tmp.remaining(),
13689 )
13690 }
13691 __tmp.put_u64_le(self.time_usec);
13692 __tmp.put_u32_le(self.time_week_ms);
13693 __tmp.put_i32_le(self.lat);
13694 __tmp.put_i32_le(self.lon);
13695 __tmp.put_f32_le(self.alt);
13696 __tmp.put_f32_le(self.hdop);
13697 __tmp.put_f32_le(self.vdop);
13698 __tmp.put_f32_le(self.vn);
13699 __tmp.put_f32_le(self.ve);
13700 __tmp.put_f32_le(self.vd);
13701 __tmp.put_f32_le(self.speed_accuracy);
13702 __tmp.put_f32_le(self.horiz_accuracy);
13703 __tmp.put_f32_le(self.vert_accuracy);
13704 __tmp.put_u16_le(self.ignore_flags.bits());
13705 __tmp.put_u16_le(self.time_week);
13706 __tmp.put_u8(self.gps_id);
13707 __tmp.put_u8(self.fix_type);
13708 __tmp.put_u8(self.satellites_visible);
13709 __tmp.put_u16_le(self.yaw);
13710 if matches!(version, MavlinkVersion::V2) {
13711 let len = __tmp.len();
13712 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13713 } else {
13714 __tmp.len()
13715 }
13716 }
13717}
13718#[doc = "id: 24"]
13719#[doc = "The global position, as returned by the Global Positioning System (GPS). This is NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION_INT for the global position estimate."]
13720#[derive(Debug, Clone, PartialEq)]
13721#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13722#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13723pub struct GPS_RAW_INT_DATA {
13724 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
13725 pub time_usec: u64,
13726 #[doc = "Latitude (WGS84, EGM96 ellipsoid)"]
13727 pub lat: i32,
13728 #[doc = "Longitude (WGS84, EGM96 ellipsoid)"]
13729 pub lon: i32,
13730 #[doc = "Altitude (MSL). Positive for up. Note that virtually all GPS modules provide the MSL altitude in addition to the WGS84 altitude."]
13731 pub alt: i32,
13732 #[doc = "GPS HDOP horizontal dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
13733 pub eph: u16,
13734 #[doc = "GPS VDOP vertical dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
13735 pub epv: u16,
13736 #[doc = "GPS ground speed. If unknown, set to: UINT16_MAX"]
13737 pub vel: u16,
13738 #[doc = "Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
13739 pub cog: u16,
13740 #[doc = "GPS fix type."]
13741 pub fix_type: GpsFixType,
13742 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
13743 pub satellites_visible: u8,
13744 #[doc = "Altitude (above WGS84, EGM96 ellipsoid). Positive for up."]
13745 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13746 pub alt_ellipsoid: i32,
13747 #[doc = "Position uncertainty."]
13748 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13749 pub h_acc: u32,
13750 #[doc = "Altitude uncertainty."]
13751 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13752 pub v_acc: u32,
13753 #[doc = "Speed uncertainty."]
13754 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13755 pub vel_acc: u32,
13756 #[doc = "Heading / track uncertainty"]
13757 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13758 pub hdg_acc: u32,
13759 #[doc = "Yaw in earth frame from north. Use 0 if this GPS does not provide yaw. Use UINT16_MAX if this GPS is configured to provide yaw and is currently unable to provide it. Use 36000 for north."]
13760 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13761 pub yaw: u16,
13762}
13763impl GPS_RAW_INT_DATA {
13764 pub const ENCODED_LEN: usize = 52usize;
13765 pub const DEFAULT: Self = Self {
13766 time_usec: 0_u64,
13767 lat: 0_i32,
13768 lon: 0_i32,
13769 alt: 0_i32,
13770 eph: 0_u16,
13771 epv: 0_u16,
13772 vel: 0_u16,
13773 cog: 0_u16,
13774 fix_type: GpsFixType::DEFAULT,
13775 satellites_visible: 0_u8,
13776 alt_ellipsoid: 0_i32,
13777 h_acc: 0_u32,
13778 v_acc: 0_u32,
13779 vel_acc: 0_u32,
13780 hdg_acc: 0_u32,
13781 yaw: 0_u16,
13782 };
13783 #[cfg(feature = "arbitrary")]
13784 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13785 use arbitrary::{Arbitrary, Unstructured};
13786 let mut buf = [0u8; 1024];
13787 rng.fill_bytes(&mut buf);
13788 let mut unstructured = Unstructured::new(&buf);
13789 Self::arbitrary(&mut unstructured).unwrap_or_default()
13790 }
13791}
13792impl Default for GPS_RAW_INT_DATA {
13793 fn default() -> Self {
13794 Self::DEFAULT.clone()
13795 }
13796}
13797impl MessageData for GPS_RAW_INT_DATA {
13798 type Message = MavMessage;
13799 const ID: u32 = 24u32;
13800 const NAME: &'static str = "GPS_RAW_INT";
13801 const EXTRA_CRC: u8 = 24u8;
13802 const ENCODED_LEN: usize = 52usize;
13803 fn deser(
13804 _version: MavlinkVersion,
13805 __input: &[u8],
13806 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13807 let avail_len = __input.len();
13808 let mut payload_buf = [0; Self::ENCODED_LEN];
13809 let mut buf = if avail_len < Self::ENCODED_LEN {
13810 payload_buf[0..avail_len].copy_from_slice(__input);
13811 Bytes::new(&payload_buf)
13812 } else {
13813 Bytes::new(__input)
13814 };
13815 let mut __struct = Self::default();
13816 __struct.time_usec = buf.get_u64_le();
13817 __struct.lat = buf.get_i32_le();
13818 __struct.lon = buf.get_i32_le();
13819 __struct.alt = buf.get_i32_le();
13820 __struct.eph = buf.get_u16_le();
13821 __struct.epv = buf.get_u16_le();
13822 __struct.vel = buf.get_u16_le();
13823 __struct.cog = buf.get_u16_le();
13824 let tmp = buf.get_u8();
13825 __struct.fix_type =
13826 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
13827 enum_type: "GpsFixType",
13828 value: tmp as u32,
13829 })?;
13830 __struct.satellites_visible = buf.get_u8();
13831 __struct.alt_ellipsoid = buf.get_i32_le();
13832 __struct.h_acc = buf.get_u32_le();
13833 __struct.v_acc = buf.get_u32_le();
13834 __struct.vel_acc = buf.get_u32_le();
13835 __struct.hdg_acc = buf.get_u32_le();
13836 __struct.yaw = buf.get_u16_le();
13837 Ok(__struct)
13838 }
13839 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13840 let mut __tmp = BytesMut::new(bytes);
13841 #[allow(clippy::absurd_extreme_comparisons)]
13842 #[allow(unused_comparisons)]
13843 if __tmp.remaining() < Self::ENCODED_LEN {
13844 panic!(
13845 "buffer is too small (need {} bytes, but got {})",
13846 Self::ENCODED_LEN,
13847 __tmp.remaining(),
13848 )
13849 }
13850 __tmp.put_u64_le(self.time_usec);
13851 __tmp.put_i32_le(self.lat);
13852 __tmp.put_i32_le(self.lon);
13853 __tmp.put_i32_le(self.alt);
13854 __tmp.put_u16_le(self.eph);
13855 __tmp.put_u16_le(self.epv);
13856 __tmp.put_u16_le(self.vel);
13857 __tmp.put_u16_le(self.cog);
13858 __tmp.put_u8(self.fix_type as u8);
13859 __tmp.put_u8(self.satellites_visible);
13860 __tmp.put_i32_le(self.alt_ellipsoid);
13861 __tmp.put_u32_le(self.h_acc);
13862 __tmp.put_u32_le(self.v_acc);
13863 __tmp.put_u32_le(self.vel_acc);
13864 __tmp.put_u32_le(self.hdg_acc);
13865 __tmp.put_u16_le(self.yaw);
13866 if matches!(version, MavlinkVersion::V2) {
13867 let len = __tmp.len();
13868 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13869 } else {
13870 __tmp.len()
13871 }
13872 }
13873}
13874#[doc = "id: 233"]
13875#[doc = "RTCM message for injecting into the onboard GPS (used for DGPS)."]
13876#[derive(Debug, Clone, PartialEq)]
13877#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13878#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13879pub struct GPS_RTCM_DATA_DATA {
13880 #[doc = "LSB: 1 means message is fragmented, next 2 bits are the fragment ID, the remaining 5 bits are used for the sequence ID. Messages are only to be flushed to the GPS when the entire message has been reconstructed on the autopilot. The fragment ID specifies which order the fragments should be assembled into a buffer, while the sequence ID is used to detect a mismatch between different buffers. The buffer is considered fully reconstructed when either all 4 fragments are present, or all the fragments before the first fragment with a non full payload is received. This management is used to ensure that normal GPS operation doesn't corrupt RTCM data, and to recover from a unreliable transport delivery order."]
13881 pub flags: u8,
13882 #[doc = "data length"]
13883 pub len: u8,
13884 #[doc = "RTCM message (may be fragmented)"]
13885 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
13886 pub data: [u8; 180],
13887}
13888impl GPS_RTCM_DATA_DATA {
13889 pub const ENCODED_LEN: usize = 182usize;
13890 pub const DEFAULT: Self = Self {
13891 flags: 0_u8,
13892 len: 0_u8,
13893 data: [0_u8; 180usize],
13894 };
13895 #[cfg(feature = "arbitrary")]
13896 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13897 use arbitrary::{Arbitrary, Unstructured};
13898 let mut buf = [0u8; 1024];
13899 rng.fill_bytes(&mut buf);
13900 let mut unstructured = Unstructured::new(&buf);
13901 Self::arbitrary(&mut unstructured).unwrap_or_default()
13902 }
13903}
13904impl Default for GPS_RTCM_DATA_DATA {
13905 fn default() -> Self {
13906 Self::DEFAULT.clone()
13907 }
13908}
13909impl MessageData for GPS_RTCM_DATA_DATA {
13910 type Message = MavMessage;
13911 const ID: u32 = 233u32;
13912 const NAME: &'static str = "GPS_RTCM_DATA";
13913 const EXTRA_CRC: u8 = 35u8;
13914 const ENCODED_LEN: usize = 182usize;
13915 fn deser(
13916 _version: MavlinkVersion,
13917 __input: &[u8],
13918 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13919 let avail_len = __input.len();
13920 let mut payload_buf = [0; Self::ENCODED_LEN];
13921 let mut buf = if avail_len < Self::ENCODED_LEN {
13922 payload_buf[0..avail_len].copy_from_slice(__input);
13923 Bytes::new(&payload_buf)
13924 } else {
13925 Bytes::new(__input)
13926 };
13927 let mut __struct = Self::default();
13928 __struct.flags = buf.get_u8();
13929 __struct.len = buf.get_u8();
13930 for v in &mut __struct.data {
13931 let val = buf.get_u8();
13932 *v = val;
13933 }
13934 Ok(__struct)
13935 }
13936 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13937 let mut __tmp = BytesMut::new(bytes);
13938 #[allow(clippy::absurd_extreme_comparisons)]
13939 #[allow(unused_comparisons)]
13940 if __tmp.remaining() < Self::ENCODED_LEN {
13941 panic!(
13942 "buffer is too small (need {} bytes, but got {})",
13943 Self::ENCODED_LEN,
13944 __tmp.remaining(),
13945 )
13946 }
13947 __tmp.put_u8(self.flags);
13948 __tmp.put_u8(self.len);
13949 for val in &self.data {
13950 __tmp.put_u8(*val);
13951 }
13952 if matches!(version, MavlinkVersion::V2) {
13953 let len = __tmp.len();
13954 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13955 } else {
13956 __tmp.len()
13957 }
13958 }
13959}
13960#[doc = "id: 127"]
13961#[doc = "RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting."]
13962#[derive(Debug, Clone, PartialEq)]
13963#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13964#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13965pub struct GPS_RTK_DATA {
13966 #[doc = "Time since boot of last baseline message received."]
13967 pub time_last_baseline_ms: u32,
13968 #[doc = "GPS Time of Week of last baseline"]
13969 pub tow: u32,
13970 #[doc = "Current baseline in ECEF x or NED north component."]
13971 pub baseline_a_mm: i32,
13972 #[doc = "Current baseline in ECEF y or NED east component."]
13973 pub baseline_b_mm: i32,
13974 #[doc = "Current baseline in ECEF z or NED down component."]
13975 pub baseline_c_mm: i32,
13976 #[doc = "Current estimate of baseline accuracy."]
13977 pub accuracy: u32,
13978 #[doc = "Current number of integer ambiguity hypotheses."]
13979 pub iar_num_hypotheses: i32,
13980 #[doc = "GPS Week Number of last baseline"]
13981 pub wn: u16,
13982 #[doc = "Identification of connected RTK receiver."]
13983 pub rtk_receiver_id: u8,
13984 #[doc = "GPS-specific health report for RTK data."]
13985 pub rtk_health: u8,
13986 #[doc = "Rate of baseline messages being received by GPS"]
13987 pub rtk_rate: u8,
13988 #[doc = "Current number of sats used for RTK calculation."]
13989 pub nsats: u8,
13990 #[doc = "Coordinate system of baseline"]
13991 pub baseline_coords_type: RtkBaselineCoordinateSystem,
13992}
13993impl GPS_RTK_DATA {
13994 pub const ENCODED_LEN: usize = 35usize;
13995 pub const DEFAULT: Self = Self {
13996 time_last_baseline_ms: 0_u32,
13997 tow: 0_u32,
13998 baseline_a_mm: 0_i32,
13999 baseline_b_mm: 0_i32,
14000 baseline_c_mm: 0_i32,
14001 accuracy: 0_u32,
14002 iar_num_hypotheses: 0_i32,
14003 wn: 0_u16,
14004 rtk_receiver_id: 0_u8,
14005 rtk_health: 0_u8,
14006 rtk_rate: 0_u8,
14007 nsats: 0_u8,
14008 baseline_coords_type: RtkBaselineCoordinateSystem::DEFAULT,
14009 };
14010 #[cfg(feature = "arbitrary")]
14011 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14012 use arbitrary::{Arbitrary, Unstructured};
14013 let mut buf = [0u8; 1024];
14014 rng.fill_bytes(&mut buf);
14015 let mut unstructured = Unstructured::new(&buf);
14016 Self::arbitrary(&mut unstructured).unwrap_or_default()
14017 }
14018}
14019impl Default for GPS_RTK_DATA {
14020 fn default() -> Self {
14021 Self::DEFAULT.clone()
14022 }
14023}
14024impl MessageData for GPS_RTK_DATA {
14025 type Message = MavMessage;
14026 const ID: u32 = 127u32;
14027 const NAME: &'static str = "GPS_RTK";
14028 const EXTRA_CRC: u8 = 25u8;
14029 const ENCODED_LEN: usize = 35usize;
14030 fn deser(
14031 _version: MavlinkVersion,
14032 __input: &[u8],
14033 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14034 let avail_len = __input.len();
14035 let mut payload_buf = [0; Self::ENCODED_LEN];
14036 let mut buf = if avail_len < Self::ENCODED_LEN {
14037 payload_buf[0..avail_len].copy_from_slice(__input);
14038 Bytes::new(&payload_buf)
14039 } else {
14040 Bytes::new(__input)
14041 };
14042 let mut __struct = Self::default();
14043 __struct.time_last_baseline_ms = buf.get_u32_le();
14044 __struct.tow = buf.get_u32_le();
14045 __struct.baseline_a_mm = buf.get_i32_le();
14046 __struct.baseline_b_mm = buf.get_i32_le();
14047 __struct.baseline_c_mm = buf.get_i32_le();
14048 __struct.accuracy = buf.get_u32_le();
14049 __struct.iar_num_hypotheses = buf.get_i32_le();
14050 __struct.wn = buf.get_u16_le();
14051 __struct.rtk_receiver_id = buf.get_u8();
14052 __struct.rtk_health = buf.get_u8();
14053 __struct.rtk_rate = buf.get_u8();
14054 __struct.nsats = buf.get_u8();
14055 let tmp = buf.get_u8();
14056 __struct.baseline_coords_type =
14057 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14058 enum_type: "RtkBaselineCoordinateSystem",
14059 value: tmp as u32,
14060 })?;
14061 Ok(__struct)
14062 }
14063 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14064 let mut __tmp = BytesMut::new(bytes);
14065 #[allow(clippy::absurd_extreme_comparisons)]
14066 #[allow(unused_comparisons)]
14067 if __tmp.remaining() < Self::ENCODED_LEN {
14068 panic!(
14069 "buffer is too small (need {} bytes, but got {})",
14070 Self::ENCODED_LEN,
14071 __tmp.remaining(),
14072 )
14073 }
14074 __tmp.put_u32_le(self.time_last_baseline_ms);
14075 __tmp.put_u32_le(self.tow);
14076 __tmp.put_i32_le(self.baseline_a_mm);
14077 __tmp.put_i32_le(self.baseline_b_mm);
14078 __tmp.put_i32_le(self.baseline_c_mm);
14079 __tmp.put_u32_le(self.accuracy);
14080 __tmp.put_i32_le(self.iar_num_hypotheses);
14081 __tmp.put_u16_le(self.wn);
14082 __tmp.put_u8(self.rtk_receiver_id);
14083 __tmp.put_u8(self.rtk_health);
14084 __tmp.put_u8(self.rtk_rate);
14085 __tmp.put_u8(self.nsats);
14086 __tmp.put_u8(self.baseline_coords_type as u8);
14087 if matches!(version, MavlinkVersion::V2) {
14088 let len = __tmp.len();
14089 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14090 } else {
14091 __tmp.len()
14092 }
14093 }
14094}
14095#[doc = "id: 25"]
14096#[doc = "The positioning status, as reported by GPS. This message is intended to display status information about each satellite visible to the receiver. See message GLOBAL_POSITION_INT for the global position estimate. This message can contain information for up to 20 satellites."]
14097#[derive(Debug, Clone, PartialEq)]
14098#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14099#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14100pub struct GPS_STATUS_DATA {
14101 #[doc = "Number of satellites visible"]
14102 pub satellites_visible: u8,
14103 #[doc = "Global satellite ID"]
14104 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14105 pub satellite_prn: [u8; 20],
14106 #[doc = "0: Satellite not used, 1: used for localization"]
14107 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14108 pub satellite_used: [u8; 20],
14109 #[doc = "Elevation (0: right on top of receiver, 90: on the horizon) of satellite"]
14110 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14111 pub satellite_elevation: [u8; 20],
14112 #[doc = "Direction of satellite, 0: 0 deg, 255: 360 deg."]
14113 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14114 pub satellite_azimuth: [u8; 20],
14115 #[doc = "Signal to noise ratio of satellite"]
14116 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14117 pub satellite_snr: [u8; 20],
14118}
14119impl GPS_STATUS_DATA {
14120 pub const ENCODED_LEN: usize = 101usize;
14121 pub const DEFAULT: Self = Self {
14122 satellites_visible: 0_u8,
14123 satellite_prn: [0_u8; 20usize],
14124 satellite_used: [0_u8; 20usize],
14125 satellite_elevation: [0_u8; 20usize],
14126 satellite_azimuth: [0_u8; 20usize],
14127 satellite_snr: [0_u8; 20usize],
14128 };
14129 #[cfg(feature = "arbitrary")]
14130 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14131 use arbitrary::{Arbitrary, Unstructured};
14132 let mut buf = [0u8; 1024];
14133 rng.fill_bytes(&mut buf);
14134 let mut unstructured = Unstructured::new(&buf);
14135 Self::arbitrary(&mut unstructured).unwrap_or_default()
14136 }
14137}
14138impl Default for GPS_STATUS_DATA {
14139 fn default() -> Self {
14140 Self::DEFAULT.clone()
14141 }
14142}
14143impl MessageData for GPS_STATUS_DATA {
14144 type Message = MavMessage;
14145 const ID: u32 = 25u32;
14146 const NAME: &'static str = "GPS_STATUS";
14147 const EXTRA_CRC: u8 = 23u8;
14148 const ENCODED_LEN: usize = 101usize;
14149 fn deser(
14150 _version: MavlinkVersion,
14151 __input: &[u8],
14152 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14153 let avail_len = __input.len();
14154 let mut payload_buf = [0; Self::ENCODED_LEN];
14155 let mut buf = if avail_len < Self::ENCODED_LEN {
14156 payload_buf[0..avail_len].copy_from_slice(__input);
14157 Bytes::new(&payload_buf)
14158 } else {
14159 Bytes::new(__input)
14160 };
14161 let mut __struct = Self::default();
14162 __struct.satellites_visible = buf.get_u8();
14163 for v in &mut __struct.satellite_prn {
14164 let val = buf.get_u8();
14165 *v = val;
14166 }
14167 for v in &mut __struct.satellite_used {
14168 let val = buf.get_u8();
14169 *v = val;
14170 }
14171 for v in &mut __struct.satellite_elevation {
14172 let val = buf.get_u8();
14173 *v = val;
14174 }
14175 for v in &mut __struct.satellite_azimuth {
14176 let val = buf.get_u8();
14177 *v = val;
14178 }
14179 for v in &mut __struct.satellite_snr {
14180 let val = buf.get_u8();
14181 *v = val;
14182 }
14183 Ok(__struct)
14184 }
14185 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14186 let mut __tmp = BytesMut::new(bytes);
14187 #[allow(clippy::absurd_extreme_comparisons)]
14188 #[allow(unused_comparisons)]
14189 if __tmp.remaining() < Self::ENCODED_LEN {
14190 panic!(
14191 "buffer is too small (need {} bytes, but got {})",
14192 Self::ENCODED_LEN,
14193 __tmp.remaining(),
14194 )
14195 }
14196 __tmp.put_u8(self.satellites_visible);
14197 for val in &self.satellite_prn {
14198 __tmp.put_u8(*val);
14199 }
14200 for val in &self.satellite_used {
14201 __tmp.put_u8(*val);
14202 }
14203 for val in &self.satellite_elevation {
14204 __tmp.put_u8(*val);
14205 }
14206 for val in &self.satellite_azimuth {
14207 __tmp.put_u8(*val);
14208 }
14209 for val in &self.satellite_snr {
14210 __tmp.put_u8(*val);
14211 }
14212 if matches!(version, MavlinkVersion::V2) {
14213 let len = __tmp.len();
14214 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14215 } else {
14216 __tmp.len()
14217 }
14218 }
14219}
14220#[doc = "id: 0"]
14221#[doc = "The heartbeat message shows that a system or component is present and responding. The type and autopilot fields (along with the message component id), allow the receiving system to treat further messages from this system appropriately (e.g. by laying out the user interface based on the autopilot). This microservice is documented at <https://mavlink.io/en/services/heartbeat.html>."]
14222#[derive(Debug, Clone, PartialEq)]
14223#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14224#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14225pub struct HEARTBEAT_DATA {
14226 #[doc = "A bitfield for use for autopilot-specific flags"]
14227 pub custom_mode: u32,
14228 #[doc = "Vehicle or component type. For a flight controller component the vehicle type (quadrotor, helicopter, etc.). For other components the component type (e.g. camera, gimbal, etc.). This should be used in preference to component id for identifying the component type."]
14229 pub mavtype: MavType,
14230 #[doc = "Autopilot type / class. Use MAV_AUTOPILOT_INVALID for components that are not flight controllers."]
14231 pub autopilot: MavAutopilot,
14232 #[doc = "System mode bitmap."]
14233 pub base_mode: MavModeFlag,
14234 #[doc = "System status flag."]
14235 pub system_status: MavState,
14236 #[doc = "MAVLink version, not writable by user, gets added by protocol because of magic data type: uint8_t_mavlink_version"]
14237 pub mavlink_version: u8,
14238}
14239impl HEARTBEAT_DATA {
14240 pub const ENCODED_LEN: usize = 9usize;
14241 pub const DEFAULT: Self = Self {
14242 custom_mode: 0_u32,
14243 mavtype: MavType::DEFAULT,
14244 autopilot: MavAutopilot::DEFAULT,
14245 base_mode: MavModeFlag::DEFAULT,
14246 system_status: MavState::DEFAULT,
14247 mavlink_version: MINOR_MAVLINK_VERSION,
14248 };
14249 #[cfg(feature = "arbitrary")]
14250 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14251 use arbitrary::{Arbitrary, Unstructured};
14252 let mut buf = [0u8; 1024];
14253 rng.fill_bytes(&mut buf);
14254 let mut unstructured = Unstructured::new(&buf);
14255 Self::arbitrary(&mut unstructured).unwrap_or_default()
14256 }
14257}
14258impl Default for HEARTBEAT_DATA {
14259 fn default() -> Self {
14260 Self::DEFAULT.clone()
14261 }
14262}
14263impl MessageData for HEARTBEAT_DATA {
14264 type Message = MavMessage;
14265 const ID: u32 = 0u32;
14266 const NAME: &'static str = "HEARTBEAT";
14267 const EXTRA_CRC: u8 = 50u8;
14268 const ENCODED_LEN: usize = 9usize;
14269 fn deser(
14270 _version: MavlinkVersion,
14271 __input: &[u8],
14272 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14273 let avail_len = __input.len();
14274 let mut payload_buf = [0; Self::ENCODED_LEN];
14275 let mut buf = if avail_len < Self::ENCODED_LEN {
14276 payload_buf[0..avail_len].copy_from_slice(__input);
14277 Bytes::new(&payload_buf)
14278 } else {
14279 Bytes::new(__input)
14280 };
14281 let mut __struct = Self::default();
14282 __struct.custom_mode = buf.get_u32_le();
14283 let tmp = buf.get_u8();
14284 __struct.mavtype =
14285 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14286 enum_type: "MavType",
14287 value: tmp as u32,
14288 })?;
14289 let tmp = buf.get_u8();
14290 __struct.autopilot =
14291 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14292 enum_type: "MavAutopilot",
14293 value: tmp as u32,
14294 })?;
14295 let tmp = buf.get_u8();
14296 __struct.base_mode = MavModeFlag::from_bits(tmp & MavModeFlag::all().bits()).ok_or(
14297 ::mavlink_core::error::ParserError::InvalidFlag {
14298 flag_type: "MavModeFlag",
14299 value: tmp as u32,
14300 },
14301 )?;
14302 let tmp = buf.get_u8();
14303 __struct.system_status =
14304 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14305 enum_type: "MavState",
14306 value: tmp as u32,
14307 })?;
14308 __struct.mavlink_version = buf.get_u8();
14309 Ok(__struct)
14310 }
14311 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14312 let mut __tmp = BytesMut::new(bytes);
14313 #[allow(clippy::absurd_extreme_comparisons)]
14314 #[allow(unused_comparisons)]
14315 if __tmp.remaining() < Self::ENCODED_LEN {
14316 panic!(
14317 "buffer is too small (need {} bytes, but got {})",
14318 Self::ENCODED_LEN,
14319 __tmp.remaining(),
14320 )
14321 }
14322 __tmp.put_u32_le(self.custom_mode);
14323 __tmp.put_u8(self.mavtype as u8);
14324 __tmp.put_u8(self.autopilot as u8);
14325 __tmp.put_u8(self.base_mode.bits());
14326 __tmp.put_u8(self.system_status as u8);
14327 __tmp.put_u8(self.mavlink_version);
14328 if matches!(version, MavlinkVersion::V2) {
14329 let len = __tmp.len();
14330 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14331 } else {
14332 __tmp.len()
14333 }
14334 }
14335}
14336#[doc = "id: 105"]
14337#[doc = "The IMU readings in SI units in NED body frame."]
14338#[derive(Debug, Clone, PartialEq)]
14339#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14340#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14341pub struct HIGHRES_IMU_DATA {
14342 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
14343 pub time_usec: u64,
14344 #[doc = "X acceleration"]
14345 pub xacc: f32,
14346 #[doc = "Y acceleration"]
14347 pub yacc: f32,
14348 #[doc = "Z acceleration"]
14349 pub zacc: f32,
14350 #[doc = "Angular speed around X axis"]
14351 pub xgyro: f32,
14352 #[doc = "Angular speed around Y axis"]
14353 pub ygyro: f32,
14354 #[doc = "Angular speed around Z axis"]
14355 pub zgyro: f32,
14356 #[doc = "X Magnetic field"]
14357 pub xmag: f32,
14358 #[doc = "Y Magnetic field"]
14359 pub ymag: f32,
14360 #[doc = "Z Magnetic field"]
14361 pub zmag: f32,
14362 #[doc = "Absolute pressure"]
14363 pub abs_pressure: f32,
14364 #[doc = "Differential pressure"]
14365 pub diff_pressure: f32,
14366 #[doc = "Altitude calculated from pressure"]
14367 pub pressure_alt: f32,
14368 #[doc = "Temperature"]
14369 pub temperature: f32,
14370 #[doc = "Bitmap for fields that have updated since last message"]
14371 pub fields_updated: HighresImuUpdatedFlags,
14372 #[doc = "Id. Ids are numbered from 0 and map to IMUs numbered from 1 (e.g. IMU1 will have a message with id=0)"]
14373 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14374 pub id: u8,
14375}
14376impl HIGHRES_IMU_DATA {
14377 pub const ENCODED_LEN: usize = 63usize;
14378 pub const DEFAULT: Self = Self {
14379 time_usec: 0_u64,
14380 xacc: 0.0_f32,
14381 yacc: 0.0_f32,
14382 zacc: 0.0_f32,
14383 xgyro: 0.0_f32,
14384 ygyro: 0.0_f32,
14385 zgyro: 0.0_f32,
14386 xmag: 0.0_f32,
14387 ymag: 0.0_f32,
14388 zmag: 0.0_f32,
14389 abs_pressure: 0.0_f32,
14390 diff_pressure: 0.0_f32,
14391 pressure_alt: 0.0_f32,
14392 temperature: 0.0_f32,
14393 fields_updated: HighresImuUpdatedFlags::DEFAULT,
14394 id: 0_u8,
14395 };
14396 #[cfg(feature = "arbitrary")]
14397 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14398 use arbitrary::{Arbitrary, Unstructured};
14399 let mut buf = [0u8; 1024];
14400 rng.fill_bytes(&mut buf);
14401 let mut unstructured = Unstructured::new(&buf);
14402 Self::arbitrary(&mut unstructured).unwrap_or_default()
14403 }
14404}
14405impl Default for HIGHRES_IMU_DATA {
14406 fn default() -> Self {
14407 Self::DEFAULT.clone()
14408 }
14409}
14410impl MessageData for HIGHRES_IMU_DATA {
14411 type Message = MavMessage;
14412 const ID: u32 = 105u32;
14413 const NAME: &'static str = "HIGHRES_IMU";
14414 const EXTRA_CRC: u8 = 93u8;
14415 const ENCODED_LEN: usize = 63usize;
14416 fn deser(
14417 _version: MavlinkVersion,
14418 __input: &[u8],
14419 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14420 let avail_len = __input.len();
14421 let mut payload_buf = [0; Self::ENCODED_LEN];
14422 let mut buf = if avail_len < Self::ENCODED_LEN {
14423 payload_buf[0..avail_len].copy_from_slice(__input);
14424 Bytes::new(&payload_buf)
14425 } else {
14426 Bytes::new(__input)
14427 };
14428 let mut __struct = Self::default();
14429 __struct.time_usec = buf.get_u64_le();
14430 __struct.xacc = buf.get_f32_le();
14431 __struct.yacc = buf.get_f32_le();
14432 __struct.zacc = buf.get_f32_le();
14433 __struct.xgyro = buf.get_f32_le();
14434 __struct.ygyro = buf.get_f32_le();
14435 __struct.zgyro = buf.get_f32_le();
14436 __struct.xmag = buf.get_f32_le();
14437 __struct.ymag = buf.get_f32_le();
14438 __struct.zmag = buf.get_f32_le();
14439 __struct.abs_pressure = buf.get_f32_le();
14440 __struct.diff_pressure = buf.get_f32_le();
14441 __struct.pressure_alt = buf.get_f32_le();
14442 __struct.temperature = buf.get_f32_le();
14443 let tmp = buf.get_u16_le();
14444 __struct.fields_updated = HighresImuUpdatedFlags::from_bits(
14445 tmp & HighresImuUpdatedFlags::all().bits(),
14446 )
14447 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
14448 flag_type: "HighresImuUpdatedFlags",
14449 value: tmp as u32,
14450 })?;
14451 __struct.id = buf.get_u8();
14452 Ok(__struct)
14453 }
14454 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14455 let mut __tmp = BytesMut::new(bytes);
14456 #[allow(clippy::absurd_extreme_comparisons)]
14457 #[allow(unused_comparisons)]
14458 if __tmp.remaining() < Self::ENCODED_LEN {
14459 panic!(
14460 "buffer is too small (need {} bytes, but got {})",
14461 Self::ENCODED_LEN,
14462 __tmp.remaining(),
14463 )
14464 }
14465 __tmp.put_u64_le(self.time_usec);
14466 __tmp.put_f32_le(self.xacc);
14467 __tmp.put_f32_le(self.yacc);
14468 __tmp.put_f32_le(self.zacc);
14469 __tmp.put_f32_le(self.xgyro);
14470 __tmp.put_f32_le(self.ygyro);
14471 __tmp.put_f32_le(self.zgyro);
14472 __tmp.put_f32_le(self.xmag);
14473 __tmp.put_f32_le(self.ymag);
14474 __tmp.put_f32_le(self.zmag);
14475 __tmp.put_f32_le(self.abs_pressure);
14476 __tmp.put_f32_le(self.diff_pressure);
14477 __tmp.put_f32_le(self.pressure_alt);
14478 __tmp.put_f32_le(self.temperature);
14479 __tmp.put_u16_le(self.fields_updated.bits());
14480 __tmp.put_u8(self.id);
14481 if matches!(version, MavlinkVersion::V2) {
14482 let len = __tmp.len();
14483 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14484 } else {
14485 __tmp.len()
14486 }
14487 }
14488}
14489#[deprecated = " See `HIGH_LATENCY2` (Deprecated since 2020-10)"]
14490#[doc = "id: 234"]
14491#[doc = "Message appropriate for high latency connections like Iridium."]
14492#[derive(Debug, Clone, PartialEq)]
14493#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14494#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14495pub struct HIGH_LATENCY_DATA {
14496 #[doc = "A bitfield for use for autopilot-specific flags."]
14497 pub custom_mode: u32,
14498 #[doc = "Latitude"]
14499 pub latitude: i32,
14500 #[doc = "Longitude"]
14501 pub longitude: i32,
14502 #[doc = "roll"]
14503 pub roll: i16,
14504 #[doc = "pitch"]
14505 pub pitch: i16,
14506 #[doc = "heading"]
14507 pub heading: u16,
14508 #[doc = "heading setpoint"]
14509 pub heading_sp: i16,
14510 #[doc = "Altitude above mean sea level"]
14511 pub altitude_amsl: i16,
14512 #[doc = "Altitude setpoint relative to the home position"]
14513 pub altitude_sp: i16,
14514 #[doc = "distance to target"]
14515 pub wp_distance: u16,
14516 #[doc = "Bitmap of enabled system modes."]
14517 pub base_mode: MavModeFlag,
14518 #[doc = "The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown."]
14519 pub landed_state: MavLandedState,
14520 #[doc = "throttle (percentage)"]
14521 pub throttle: i8,
14522 #[doc = "airspeed"]
14523 pub airspeed: u8,
14524 #[doc = "airspeed setpoint"]
14525 pub airspeed_sp: u8,
14526 #[doc = "groundspeed"]
14527 pub groundspeed: u8,
14528 #[doc = "climb rate"]
14529 pub climb_rate: i8,
14530 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
14531 pub gps_nsat: u8,
14532 #[doc = "GPS Fix type."]
14533 pub gps_fix_type: GpsFixType,
14534 #[doc = "Remaining battery (percentage)"]
14535 pub battery_remaining: u8,
14536 #[doc = "Autopilot temperature (degrees C)"]
14537 pub temperature: i8,
14538 #[doc = "Air temperature (degrees C) from airspeed sensor"]
14539 pub temperature_air: i8,
14540 #[doc = "failsafe (each bit represents a failsafe where 0=ok, 1=failsafe active (bit0:RC, bit1:batt, bit2:GPS, bit3:GCS, bit4:fence)"]
14541 pub failsafe: u8,
14542 #[doc = "current waypoint number"]
14543 pub wp_num: u8,
14544}
14545impl HIGH_LATENCY_DATA {
14546 pub const ENCODED_LEN: usize = 40usize;
14547 pub const DEFAULT: Self = Self {
14548 custom_mode: 0_u32,
14549 latitude: 0_i32,
14550 longitude: 0_i32,
14551 roll: 0_i16,
14552 pitch: 0_i16,
14553 heading: 0_u16,
14554 heading_sp: 0_i16,
14555 altitude_amsl: 0_i16,
14556 altitude_sp: 0_i16,
14557 wp_distance: 0_u16,
14558 base_mode: MavModeFlag::DEFAULT,
14559 landed_state: MavLandedState::DEFAULT,
14560 throttle: 0_i8,
14561 airspeed: 0_u8,
14562 airspeed_sp: 0_u8,
14563 groundspeed: 0_u8,
14564 climb_rate: 0_i8,
14565 gps_nsat: 0_u8,
14566 gps_fix_type: GpsFixType::DEFAULT,
14567 battery_remaining: 0_u8,
14568 temperature: 0_i8,
14569 temperature_air: 0_i8,
14570 failsafe: 0_u8,
14571 wp_num: 0_u8,
14572 };
14573 #[cfg(feature = "arbitrary")]
14574 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14575 use arbitrary::{Arbitrary, Unstructured};
14576 let mut buf = [0u8; 1024];
14577 rng.fill_bytes(&mut buf);
14578 let mut unstructured = Unstructured::new(&buf);
14579 Self::arbitrary(&mut unstructured).unwrap_or_default()
14580 }
14581}
14582impl Default for HIGH_LATENCY_DATA {
14583 fn default() -> Self {
14584 Self::DEFAULT.clone()
14585 }
14586}
14587impl MessageData for HIGH_LATENCY_DATA {
14588 type Message = MavMessage;
14589 const ID: u32 = 234u32;
14590 const NAME: &'static str = "HIGH_LATENCY";
14591 const EXTRA_CRC: u8 = 150u8;
14592 const ENCODED_LEN: usize = 40usize;
14593 fn deser(
14594 _version: MavlinkVersion,
14595 __input: &[u8],
14596 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14597 let avail_len = __input.len();
14598 let mut payload_buf = [0; Self::ENCODED_LEN];
14599 let mut buf = if avail_len < Self::ENCODED_LEN {
14600 payload_buf[0..avail_len].copy_from_slice(__input);
14601 Bytes::new(&payload_buf)
14602 } else {
14603 Bytes::new(__input)
14604 };
14605 let mut __struct = Self::default();
14606 __struct.custom_mode = buf.get_u32_le();
14607 __struct.latitude = buf.get_i32_le();
14608 __struct.longitude = buf.get_i32_le();
14609 __struct.roll = buf.get_i16_le();
14610 __struct.pitch = buf.get_i16_le();
14611 __struct.heading = buf.get_u16_le();
14612 __struct.heading_sp = buf.get_i16_le();
14613 __struct.altitude_amsl = buf.get_i16_le();
14614 __struct.altitude_sp = buf.get_i16_le();
14615 __struct.wp_distance = buf.get_u16_le();
14616 let tmp = buf.get_u8();
14617 __struct.base_mode = MavModeFlag::from_bits(tmp & MavModeFlag::all().bits()).ok_or(
14618 ::mavlink_core::error::ParserError::InvalidFlag {
14619 flag_type: "MavModeFlag",
14620 value: tmp as u32,
14621 },
14622 )?;
14623 let tmp = buf.get_u8();
14624 __struct.landed_state =
14625 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14626 enum_type: "MavLandedState",
14627 value: tmp as u32,
14628 })?;
14629 __struct.throttle = buf.get_i8();
14630 __struct.airspeed = buf.get_u8();
14631 __struct.airspeed_sp = buf.get_u8();
14632 __struct.groundspeed = buf.get_u8();
14633 __struct.climb_rate = buf.get_i8();
14634 __struct.gps_nsat = buf.get_u8();
14635 let tmp = buf.get_u8();
14636 __struct.gps_fix_type =
14637 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14638 enum_type: "GpsFixType",
14639 value: tmp as u32,
14640 })?;
14641 __struct.battery_remaining = buf.get_u8();
14642 __struct.temperature = buf.get_i8();
14643 __struct.temperature_air = buf.get_i8();
14644 __struct.failsafe = buf.get_u8();
14645 __struct.wp_num = buf.get_u8();
14646 Ok(__struct)
14647 }
14648 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14649 let mut __tmp = BytesMut::new(bytes);
14650 #[allow(clippy::absurd_extreme_comparisons)]
14651 #[allow(unused_comparisons)]
14652 if __tmp.remaining() < Self::ENCODED_LEN {
14653 panic!(
14654 "buffer is too small (need {} bytes, but got {})",
14655 Self::ENCODED_LEN,
14656 __tmp.remaining(),
14657 )
14658 }
14659 __tmp.put_u32_le(self.custom_mode);
14660 __tmp.put_i32_le(self.latitude);
14661 __tmp.put_i32_le(self.longitude);
14662 __tmp.put_i16_le(self.roll);
14663 __tmp.put_i16_le(self.pitch);
14664 __tmp.put_u16_le(self.heading);
14665 __tmp.put_i16_le(self.heading_sp);
14666 __tmp.put_i16_le(self.altitude_amsl);
14667 __tmp.put_i16_le(self.altitude_sp);
14668 __tmp.put_u16_le(self.wp_distance);
14669 __tmp.put_u8(self.base_mode.bits());
14670 __tmp.put_u8(self.landed_state as u8);
14671 __tmp.put_i8(self.throttle);
14672 __tmp.put_u8(self.airspeed);
14673 __tmp.put_u8(self.airspeed_sp);
14674 __tmp.put_u8(self.groundspeed);
14675 __tmp.put_i8(self.climb_rate);
14676 __tmp.put_u8(self.gps_nsat);
14677 __tmp.put_u8(self.gps_fix_type as u8);
14678 __tmp.put_u8(self.battery_remaining);
14679 __tmp.put_i8(self.temperature);
14680 __tmp.put_i8(self.temperature_air);
14681 __tmp.put_u8(self.failsafe);
14682 __tmp.put_u8(self.wp_num);
14683 if matches!(version, MavlinkVersion::V2) {
14684 let len = __tmp.len();
14685 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14686 } else {
14687 __tmp.len()
14688 }
14689 }
14690}
14691#[doc = "id: 235"]
14692#[doc = "Message appropriate for high latency connections like Iridium (version 2)."]
14693#[derive(Debug, Clone, PartialEq)]
14694#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14695#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14696pub struct HIGH_LATENCY2_DATA {
14697 #[doc = "Timestamp (milliseconds since boot or Unix epoch)"]
14698 pub timestamp: u32,
14699 #[doc = "Latitude"]
14700 pub latitude: i32,
14701 #[doc = "Longitude"]
14702 pub longitude: i32,
14703 #[doc = "A bitfield for use for autopilot-specific flags (2 byte version)."]
14704 pub custom_mode: u16,
14705 #[doc = "Altitude above mean sea level"]
14706 pub altitude: i16,
14707 #[doc = "Altitude setpoint"]
14708 pub target_altitude: i16,
14709 #[doc = "Distance to target waypoint or position"]
14710 pub target_distance: u16,
14711 #[doc = "Current waypoint number"]
14712 pub wp_num: u16,
14713 #[doc = "Bitmap of failure flags."]
14714 pub failure_flags: HlFailureFlag,
14715 #[doc = "Type of the MAV (quadrotor, helicopter, etc.)"]
14716 pub mavtype: MavType,
14717 #[doc = "Autopilot type / class. Use MAV_AUTOPILOT_INVALID for components that are not flight controllers."]
14718 pub autopilot: MavAutopilot,
14719 #[doc = "Heading"]
14720 pub heading: u8,
14721 #[doc = "Heading setpoint"]
14722 pub target_heading: u8,
14723 #[doc = "Throttle"]
14724 pub throttle: u8,
14725 #[doc = "Airspeed"]
14726 pub airspeed: u8,
14727 #[doc = "Airspeed setpoint"]
14728 pub airspeed_sp: u8,
14729 #[doc = "Groundspeed"]
14730 pub groundspeed: u8,
14731 #[doc = "Windspeed"]
14732 pub windspeed: u8,
14733 #[doc = "Wind heading"]
14734 pub wind_heading: u8,
14735 #[doc = "Maximum error horizontal position since last message"]
14736 pub eph: u8,
14737 #[doc = "Maximum error vertical position since last message"]
14738 pub epv: u8,
14739 #[doc = "Air temperature"]
14740 pub temperature_air: i8,
14741 #[doc = "Maximum climb rate magnitude since last message"]
14742 pub climb_rate: i8,
14743 #[doc = "Battery level (-1 if field not provided)."]
14744 pub battery: i8,
14745 #[doc = "Field for custom payload."]
14746 pub custom0: i8,
14747 #[doc = "Field for custom payload."]
14748 pub custom1: i8,
14749 #[doc = "Field for custom payload."]
14750 pub custom2: i8,
14751}
14752impl HIGH_LATENCY2_DATA {
14753 pub const ENCODED_LEN: usize = 42usize;
14754 pub const DEFAULT: Self = Self {
14755 timestamp: 0_u32,
14756 latitude: 0_i32,
14757 longitude: 0_i32,
14758 custom_mode: 0_u16,
14759 altitude: 0_i16,
14760 target_altitude: 0_i16,
14761 target_distance: 0_u16,
14762 wp_num: 0_u16,
14763 failure_flags: HlFailureFlag::DEFAULT,
14764 mavtype: MavType::DEFAULT,
14765 autopilot: MavAutopilot::DEFAULT,
14766 heading: 0_u8,
14767 target_heading: 0_u8,
14768 throttle: 0_u8,
14769 airspeed: 0_u8,
14770 airspeed_sp: 0_u8,
14771 groundspeed: 0_u8,
14772 windspeed: 0_u8,
14773 wind_heading: 0_u8,
14774 eph: 0_u8,
14775 epv: 0_u8,
14776 temperature_air: 0_i8,
14777 climb_rate: 0_i8,
14778 battery: 0_i8,
14779 custom0: 0_i8,
14780 custom1: 0_i8,
14781 custom2: 0_i8,
14782 };
14783 #[cfg(feature = "arbitrary")]
14784 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14785 use arbitrary::{Arbitrary, Unstructured};
14786 let mut buf = [0u8; 1024];
14787 rng.fill_bytes(&mut buf);
14788 let mut unstructured = Unstructured::new(&buf);
14789 Self::arbitrary(&mut unstructured).unwrap_or_default()
14790 }
14791}
14792impl Default for HIGH_LATENCY2_DATA {
14793 fn default() -> Self {
14794 Self::DEFAULT.clone()
14795 }
14796}
14797impl MessageData for HIGH_LATENCY2_DATA {
14798 type Message = MavMessage;
14799 const ID: u32 = 235u32;
14800 const NAME: &'static str = "HIGH_LATENCY2";
14801 const EXTRA_CRC: u8 = 179u8;
14802 const ENCODED_LEN: usize = 42usize;
14803 fn deser(
14804 _version: MavlinkVersion,
14805 __input: &[u8],
14806 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14807 let avail_len = __input.len();
14808 let mut payload_buf = [0; Self::ENCODED_LEN];
14809 let mut buf = if avail_len < Self::ENCODED_LEN {
14810 payload_buf[0..avail_len].copy_from_slice(__input);
14811 Bytes::new(&payload_buf)
14812 } else {
14813 Bytes::new(__input)
14814 };
14815 let mut __struct = Self::default();
14816 __struct.timestamp = buf.get_u32_le();
14817 __struct.latitude = buf.get_i32_le();
14818 __struct.longitude = buf.get_i32_le();
14819 __struct.custom_mode = buf.get_u16_le();
14820 __struct.altitude = buf.get_i16_le();
14821 __struct.target_altitude = buf.get_i16_le();
14822 __struct.target_distance = buf.get_u16_le();
14823 __struct.wp_num = buf.get_u16_le();
14824 let tmp = buf.get_u16_le();
14825 __struct.failure_flags = HlFailureFlag::from_bits(tmp & HlFailureFlag::all().bits())
14826 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
14827 flag_type: "HlFailureFlag",
14828 value: tmp as u32,
14829 })?;
14830 let tmp = buf.get_u8();
14831 __struct.mavtype =
14832 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14833 enum_type: "MavType",
14834 value: tmp as u32,
14835 })?;
14836 let tmp = buf.get_u8();
14837 __struct.autopilot =
14838 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14839 enum_type: "MavAutopilot",
14840 value: tmp as u32,
14841 })?;
14842 __struct.heading = buf.get_u8();
14843 __struct.target_heading = buf.get_u8();
14844 __struct.throttle = buf.get_u8();
14845 __struct.airspeed = buf.get_u8();
14846 __struct.airspeed_sp = buf.get_u8();
14847 __struct.groundspeed = buf.get_u8();
14848 __struct.windspeed = buf.get_u8();
14849 __struct.wind_heading = buf.get_u8();
14850 __struct.eph = buf.get_u8();
14851 __struct.epv = buf.get_u8();
14852 __struct.temperature_air = buf.get_i8();
14853 __struct.climb_rate = buf.get_i8();
14854 __struct.battery = buf.get_i8();
14855 __struct.custom0 = buf.get_i8();
14856 __struct.custom1 = buf.get_i8();
14857 __struct.custom2 = buf.get_i8();
14858 Ok(__struct)
14859 }
14860 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14861 let mut __tmp = BytesMut::new(bytes);
14862 #[allow(clippy::absurd_extreme_comparisons)]
14863 #[allow(unused_comparisons)]
14864 if __tmp.remaining() < Self::ENCODED_LEN {
14865 panic!(
14866 "buffer is too small (need {} bytes, but got {})",
14867 Self::ENCODED_LEN,
14868 __tmp.remaining(),
14869 )
14870 }
14871 __tmp.put_u32_le(self.timestamp);
14872 __tmp.put_i32_le(self.latitude);
14873 __tmp.put_i32_le(self.longitude);
14874 __tmp.put_u16_le(self.custom_mode);
14875 __tmp.put_i16_le(self.altitude);
14876 __tmp.put_i16_le(self.target_altitude);
14877 __tmp.put_u16_le(self.target_distance);
14878 __tmp.put_u16_le(self.wp_num);
14879 __tmp.put_u16_le(self.failure_flags.bits());
14880 __tmp.put_u8(self.mavtype as u8);
14881 __tmp.put_u8(self.autopilot as u8);
14882 __tmp.put_u8(self.heading);
14883 __tmp.put_u8(self.target_heading);
14884 __tmp.put_u8(self.throttle);
14885 __tmp.put_u8(self.airspeed);
14886 __tmp.put_u8(self.airspeed_sp);
14887 __tmp.put_u8(self.groundspeed);
14888 __tmp.put_u8(self.windspeed);
14889 __tmp.put_u8(self.wind_heading);
14890 __tmp.put_u8(self.eph);
14891 __tmp.put_u8(self.epv);
14892 __tmp.put_i8(self.temperature_air);
14893 __tmp.put_i8(self.climb_rate);
14894 __tmp.put_i8(self.battery);
14895 __tmp.put_i8(self.custom0);
14896 __tmp.put_i8(self.custom1);
14897 __tmp.put_i8(self.custom2);
14898 if matches!(version, MavlinkVersion::V2) {
14899 let len = __tmp.len();
14900 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14901 } else {
14902 __tmp.len()
14903 }
14904 }
14905}
14906#[doc = "id: 93"]
14907#[doc = "Sent from autopilot to simulation. Hardware in the loop control outputs. Alternative to HIL_CONTROLS."]
14908#[derive(Debug, Clone, PartialEq)]
14909#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14910#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14911pub struct HIL_ACTUATOR_CONTROLS_DATA {
14912 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
14913 pub time_usec: u64,
14914 #[doc = "Flags bitmask."]
14915 pub flags: HilActuatorControlsFlags,
14916 #[doc = "Control outputs -1 .. 1. Channel assignment depends on the simulated hardware."]
14917 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14918 pub controls: [f32; 16],
14919 #[doc = "System mode. Includes arming state."]
14920 pub mode: MavModeFlag,
14921}
14922impl HIL_ACTUATOR_CONTROLS_DATA {
14923 pub const ENCODED_LEN: usize = 81usize;
14924 pub const DEFAULT: Self = Self {
14925 time_usec: 0_u64,
14926 flags: HilActuatorControlsFlags::DEFAULT,
14927 controls: [0.0_f32; 16usize],
14928 mode: MavModeFlag::DEFAULT,
14929 };
14930 #[cfg(feature = "arbitrary")]
14931 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14932 use arbitrary::{Arbitrary, Unstructured};
14933 let mut buf = [0u8; 1024];
14934 rng.fill_bytes(&mut buf);
14935 let mut unstructured = Unstructured::new(&buf);
14936 Self::arbitrary(&mut unstructured).unwrap_or_default()
14937 }
14938}
14939impl Default for HIL_ACTUATOR_CONTROLS_DATA {
14940 fn default() -> Self {
14941 Self::DEFAULT.clone()
14942 }
14943}
14944impl MessageData for HIL_ACTUATOR_CONTROLS_DATA {
14945 type Message = MavMessage;
14946 const ID: u32 = 93u32;
14947 const NAME: &'static str = "HIL_ACTUATOR_CONTROLS";
14948 const EXTRA_CRC: u8 = 47u8;
14949 const ENCODED_LEN: usize = 81usize;
14950 fn deser(
14951 _version: MavlinkVersion,
14952 __input: &[u8],
14953 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14954 let avail_len = __input.len();
14955 let mut payload_buf = [0; Self::ENCODED_LEN];
14956 let mut buf = if avail_len < Self::ENCODED_LEN {
14957 payload_buf[0..avail_len].copy_from_slice(__input);
14958 Bytes::new(&payload_buf)
14959 } else {
14960 Bytes::new(__input)
14961 };
14962 let mut __struct = Self::default();
14963 __struct.time_usec = buf.get_u64_le();
14964 let tmp = buf.get_u64_le();
14965 __struct.flags =
14966 HilActuatorControlsFlags::from_bits(tmp & HilActuatorControlsFlags::all().bits())
14967 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
14968 flag_type: "HilActuatorControlsFlags",
14969 value: tmp as u32,
14970 })?;
14971 for v in &mut __struct.controls {
14972 let val = buf.get_f32_le();
14973 *v = val;
14974 }
14975 let tmp = buf.get_u8();
14976 __struct.mode = MavModeFlag::from_bits(tmp & MavModeFlag::all().bits()).ok_or(
14977 ::mavlink_core::error::ParserError::InvalidFlag {
14978 flag_type: "MavModeFlag",
14979 value: tmp as u32,
14980 },
14981 )?;
14982 Ok(__struct)
14983 }
14984 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14985 let mut __tmp = BytesMut::new(bytes);
14986 #[allow(clippy::absurd_extreme_comparisons)]
14987 #[allow(unused_comparisons)]
14988 if __tmp.remaining() < Self::ENCODED_LEN {
14989 panic!(
14990 "buffer is too small (need {} bytes, but got {})",
14991 Self::ENCODED_LEN,
14992 __tmp.remaining(),
14993 )
14994 }
14995 __tmp.put_u64_le(self.time_usec);
14996 __tmp.put_u64_le(self.flags.bits());
14997 for val in &self.controls {
14998 __tmp.put_f32_le(*val);
14999 }
15000 __tmp.put_u8(self.mode.bits());
15001 if matches!(version, MavlinkVersion::V2) {
15002 let len = __tmp.len();
15003 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15004 } else {
15005 __tmp.len()
15006 }
15007 }
15008}
15009#[doc = "id: 91"]
15010#[doc = "Sent from autopilot to simulation. Hardware in the loop control outputs. Alternative to HIL_ACTUATOR_CONTROLS."]
15011#[derive(Debug, Clone, PartialEq)]
15012#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15013#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15014pub struct HIL_CONTROLS_DATA {
15015 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15016 pub time_usec: u64,
15017 #[doc = "Control output -1 .. 1"]
15018 pub roll_ailerons: f32,
15019 #[doc = "Control output -1 .. 1"]
15020 pub pitch_elevator: f32,
15021 #[doc = "Control output -1 .. 1"]
15022 pub yaw_rudder: f32,
15023 #[doc = "Throttle 0 .. 1"]
15024 pub throttle: f32,
15025 #[doc = "Aux 1, -1 .. 1"]
15026 pub aux1: f32,
15027 #[doc = "Aux 2, -1 .. 1"]
15028 pub aux2: f32,
15029 #[doc = "Aux 3, -1 .. 1"]
15030 pub aux3: f32,
15031 #[doc = "Aux 4, -1 .. 1"]
15032 pub aux4: f32,
15033 #[doc = "System mode."]
15034 pub mode: MavMode,
15035 #[doc = "Navigation mode (MAV_NAV_MODE)"]
15036 pub nav_mode: u8,
15037}
15038impl HIL_CONTROLS_DATA {
15039 pub const ENCODED_LEN: usize = 42usize;
15040 pub const DEFAULT: Self = Self {
15041 time_usec: 0_u64,
15042 roll_ailerons: 0.0_f32,
15043 pitch_elevator: 0.0_f32,
15044 yaw_rudder: 0.0_f32,
15045 throttle: 0.0_f32,
15046 aux1: 0.0_f32,
15047 aux2: 0.0_f32,
15048 aux3: 0.0_f32,
15049 aux4: 0.0_f32,
15050 mode: MavMode::DEFAULT,
15051 nav_mode: 0_u8,
15052 };
15053 #[cfg(feature = "arbitrary")]
15054 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15055 use arbitrary::{Arbitrary, Unstructured};
15056 let mut buf = [0u8; 1024];
15057 rng.fill_bytes(&mut buf);
15058 let mut unstructured = Unstructured::new(&buf);
15059 Self::arbitrary(&mut unstructured).unwrap_or_default()
15060 }
15061}
15062impl Default for HIL_CONTROLS_DATA {
15063 fn default() -> Self {
15064 Self::DEFAULT.clone()
15065 }
15066}
15067impl MessageData for HIL_CONTROLS_DATA {
15068 type Message = MavMessage;
15069 const ID: u32 = 91u32;
15070 const NAME: &'static str = "HIL_CONTROLS";
15071 const EXTRA_CRC: u8 = 63u8;
15072 const ENCODED_LEN: usize = 42usize;
15073 fn deser(
15074 _version: MavlinkVersion,
15075 __input: &[u8],
15076 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15077 let avail_len = __input.len();
15078 let mut payload_buf = [0; Self::ENCODED_LEN];
15079 let mut buf = if avail_len < Self::ENCODED_LEN {
15080 payload_buf[0..avail_len].copy_from_slice(__input);
15081 Bytes::new(&payload_buf)
15082 } else {
15083 Bytes::new(__input)
15084 };
15085 let mut __struct = Self::default();
15086 __struct.time_usec = buf.get_u64_le();
15087 __struct.roll_ailerons = buf.get_f32_le();
15088 __struct.pitch_elevator = buf.get_f32_le();
15089 __struct.yaw_rudder = buf.get_f32_le();
15090 __struct.throttle = buf.get_f32_le();
15091 __struct.aux1 = buf.get_f32_le();
15092 __struct.aux2 = buf.get_f32_le();
15093 __struct.aux3 = buf.get_f32_le();
15094 __struct.aux4 = buf.get_f32_le();
15095 let tmp = buf.get_u8();
15096 __struct.mode =
15097 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15098 enum_type: "MavMode",
15099 value: tmp as u32,
15100 })?;
15101 __struct.nav_mode = buf.get_u8();
15102 Ok(__struct)
15103 }
15104 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15105 let mut __tmp = BytesMut::new(bytes);
15106 #[allow(clippy::absurd_extreme_comparisons)]
15107 #[allow(unused_comparisons)]
15108 if __tmp.remaining() < Self::ENCODED_LEN {
15109 panic!(
15110 "buffer is too small (need {} bytes, but got {})",
15111 Self::ENCODED_LEN,
15112 __tmp.remaining(),
15113 )
15114 }
15115 __tmp.put_u64_le(self.time_usec);
15116 __tmp.put_f32_le(self.roll_ailerons);
15117 __tmp.put_f32_le(self.pitch_elevator);
15118 __tmp.put_f32_le(self.yaw_rudder);
15119 __tmp.put_f32_le(self.throttle);
15120 __tmp.put_f32_le(self.aux1);
15121 __tmp.put_f32_le(self.aux2);
15122 __tmp.put_f32_le(self.aux3);
15123 __tmp.put_f32_le(self.aux4);
15124 __tmp.put_u8(self.mode as u8);
15125 __tmp.put_u8(self.nav_mode);
15126 if matches!(version, MavlinkVersion::V2) {
15127 let len = __tmp.len();
15128 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15129 } else {
15130 __tmp.len()
15131 }
15132 }
15133}
15134#[doc = "id: 113"]
15135#[doc = "The global position, as returned by the Global Positioning System (GPS). This is NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION_INT for the global position estimate."]
15136#[derive(Debug, Clone, PartialEq)]
15137#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15138#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15139pub struct HIL_GPS_DATA {
15140 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15141 pub time_usec: u64,
15142 #[doc = "Latitude (WGS84)"]
15143 pub lat: i32,
15144 #[doc = "Longitude (WGS84)"]
15145 pub lon: i32,
15146 #[doc = "Altitude (MSL). Positive for up."]
15147 pub alt: i32,
15148 #[doc = "GPS HDOP horizontal dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
15149 pub eph: u16,
15150 #[doc = "GPS VDOP vertical dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
15151 pub epv: u16,
15152 #[doc = "GPS ground speed. If unknown, set to: UINT16_MAX"]
15153 pub vel: u16,
15154 #[doc = "GPS velocity in north direction in earth-fixed NED frame"]
15155 pub vn: i16,
15156 #[doc = "GPS velocity in east direction in earth-fixed NED frame"]
15157 pub ve: i16,
15158 #[doc = "GPS velocity in down direction in earth-fixed NED frame"]
15159 pub vd: i16,
15160 #[doc = "Course over ground (NOT heading, but direction of movement), 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
15161 pub cog: u16,
15162 #[doc = "0-1: no fix, 2: 2D fix, 3: 3D fix. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix."]
15163 pub fix_type: u8,
15164 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
15165 pub satellites_visible: u8,
15166 #[doc = "GPS ID (zero indexed). Used for multiple GPS inputs"]
15167 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
15168 pub id: u8,
15169 #[doc = "Yaw of vehicle relative to Earth's North, zero means not available, use 36000 for north"]
15170 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
15171 pub yaw: u16,
15172}
15173impl HIL_GPS_DATA {
15174 pub const ENCODED_LEN: usize = 39usize;
15175 pub const DEFAULT: Self = Self {
15176 time_usec: 0_u64,
15177 lat: 0_i32,
15178 lon: 0_i32,
15179 alt: 0_i32,
15180 eph: 0_u16,
15181 epv: 0_u16,
15182 vel: 0_u16,
15183 vn: 0_i16,
15184 ve: 0_i16,
15185 vd: 0_i16,
15186 cog: 0_u16,
15187 fix_type: 0_u8,
15188 satellites_visible: 0_u8,
15189 id: 0_u8,
15190 yaw: 0_u16,
15191 };
15192 #[cfg(feature = "arbitrary")]
15193 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15194 use arbitrary::{Arbitrary, Unstructured};
15195 let mut buf = [0u8; 1024];
15196 rng.fill_bytes(&mut buf);
15197 let mut unstructured = Unstructured::new(&buf);
15198 Self::arbitrary(&mut unstructured).unwrap_or_default()
15199 }
15200}
15201impl Default for HIL_GPS_DATA {
15202 fn default() -> Self {
15203 Self::DEFAULT.clone()
15204 }
15205}
15206impl MessageData for HIL_GPS_DATA {
15207 type Message = MavMessage;
15208 const ID: u32 = 113u32;
15209 const NAME: &'static str = "HIL_GPS";
15210 const EXTRA_CRC: u8 = 124u8;
15211 const ENCODED_LEN: usize = 39usize;
15212 fn deser(
15213 _version: MavlinkVersion,
15214 __input: &[u8],
15215 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15216 let avail_len = __input.len();
15217 let mut payload_buf = [0; Self::ENCODED_LEN];
15218 let mut buf = if avail_len < Self::ENCODED_LEN {
15219 payload_buf[0..avail_len].copy_from_slice(__input);
15220 Bytes::new(&payload_buf)
15221 } else {
15222 Bytes::new(__input)
15223 };
15224 let mut __struct = Self::default();
15225 __struct.time_usec = buf.get_u64_le();
15226 __struct.lat = buf.get_i32_le();
15227 __struct.lon = buf.get_i32_le();
15228 __struct.alt = buf.get_i32_le();
15229 __struct.eph = buf.get_u16_le();
15230 __struct.epv = buf.get_u16_le();
15231 __struct.vel = buf.get_u16_le();
15232 __struct.vn = buf.get_i16_le();
15233 __struct.ve = buf.get_i16_le();
15234 __struct.vd = buf.get_i16_le();
15235 __struct.cog = buf.get_u16_le();
15236 __struct.fix_type = buf.get_u8();
15237 __struct.satellites_visible = buf.get_u8();
15238 __struct.id = buf.get_u8();
15239 __struct.yaw = buf.get_u16_le();
15240 Ok(__struct)
15241 }
15242 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15243 let mut __tmp = BytesMut::new(bytes);
15244 #[allow(clippy::absurd_extreme_comparisons)]
15245 #[allow(unused_comparisons)]
15246 if __tmp.remaining() < Self::ENCODED_LEN {
15247 panic!(
15248 "buffer is too small (need {} bytes, but got {})",
15249 Self::ENCODED_LEN,
15250 __tmp.remaining(),
15251 )
15252 }
15253 __tmp.put_u64_le(self.time_usec);
15254 __tmp.put_i32_le(self.lat);
15255 __tmp.put_i32_le(self.lon);
15256 __tmp.put_i32_le(self.alt);
15257 __tmp.put_u16_le(self.eph);
15258 __tmp.put_u16_le(self.epv);
15259 __tmp.put_u16_le(self.vel);
15260 __tmp.put_i16_le(self.vn);
15261 __tmp.put_i16_le(self.ve);
15262 __tmp.put_i16_le(self.vd);
15263 __tmp.put_u16_le(self.cog);
15264 __tmp.put_u8(self.fix_type);
15265 __tmp.put_u8(self.satellites_visible);
15266 __tmp.put_u8(self.id);
15267 __tmp.put_u16_le(self.yaw);
15268 if matches!(version, MavlinkVersion::V2) {
15269 let len = __tmp.len();
15270 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15271 } else {
15272 __tmp.len()
15273 }
15274 }
15275}
15276#[doc = "id: 114"]
15277#[doc = "Simulated optical flow from a flow sensor (e.g. PX4FLOW or optical mouse sensor)."]
15278#[derive(Debug, Clone, PartialEq)]
15279#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15280#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15281pub struct HIL_OPTICAL_FLOW_DATA {
15282 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15283 pub time_usec: u64,
15284 #[doc = "Integration time. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the."]
15285 pub integration_time_us: u32,
15286 #[doc = "Flow in radians around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.)"]
15287 pub integrated_x: f32,
15288 #[doc = "Flow in radians around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.)"]
15289 pub integrated_y: f32,
15290 #[doc = "RH rotation around X axis"]
15291 pub integrated_xgyro: f32,
15292 #[doc = "RH rotation around Y axis"]
15293 pub integrated_ygyro: f32,
15294 #[doc = "RH rotation around Z axis"]
15295 pub integrated_zgyro: f32,
15296 #[doc = "Time since the distance was sampled."]
15297 pub time_delta_distance_us: u32,
15298 #[doc = "Distance to the center of the flow field. Positive value (including zero): distance known. Negative value: Unknown distance."]
15299 pub distance: f32,
15300 #[doc = "Temperature"]
15301 pub temperature: i16,
15302 #[doc = "Sensor ID"]
15303 pub sensor_id: u8,
15304 #[doc = "Optical flow quality / confidence. 0: no valid flow, 255: maximum quality"]
15305 pub quality: u8,
15306}
15307impl HIL_OPTICAL_FLOW_DATA {
15308 pub const ENCODED_LEN: usize = 44usize;
15309 pub const DEFAULT: Self = Self {
15310 time_usec: 0_u64,
15311 integration_time_us: 0_u32,
15312 integrated_x: 0.0_f32,
15313 integrated_y: 0.0_f32,
15314 integrated_xgyro: 0.0_f32,
15315 integrated_ygyro: 0.0_f32,
15316 integrated_zgyro: 0.0_f32,
15317 time_delta_distance_us: 0_u32,
15318 distance: 0.0_f32,
15319 temperature: 0_i16,
15320 sensor_id: 0_u8,
15321 quality: 0_u8,
15322 };
15323 #[cfg(feature = "arbitrary")]
15324 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15325 use arbitrary::{Arbitrary, Unstructured};
15326 let mut buf = [0u8; 1024];
15327 rng.fill_bytes(&mut buf);
15328 let mut unstructured = Unstructured::new(&buf);
15329 Self::arbitrary(&mut unstructured).unwrap_or_default()
15330 }
15331}
15332impl Default for HIL_OPTICAL_FLOW_DATA {
15333 fn default() -> Self {
15334 Self::DEFAULT.clone()
15335 }
15336}
15337impl MessageData for HIL_OPTICAL_FLOW_DATA {
15338 type Message = MavMessage;
15339 const ID: u32 = 114u32;
15340 const NAME: &'static str = "HIL_OPTICAL_FLOW";
15341 const EXTRA_CRC: u8 = 237u8;
15342 const ENCODED_LEN: usize = 44usize;
15343 fn deser(
15344 _version: MavlinkVersion,
15345 __input: &[u8],
15346 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15347 let avail_len = __input.len();
15348 let mut payload_buf = [0; Self::ENCODED_LEN];
15349 let mut buf = if avail_len < Self::ENCODED_LEN {
15350 payload_buf[0..avail_len].copy_from_slice(__input);
15351 Bytes::new(&payload_buf)
15352 } else {
15353 Bytes::new(__input)
15354 };
15355 let mut __struct = Self::default();
15356 __struct.time_usec = buf.get_u64_le();
15357 __struct.integration_time_us = buf.get_u32_le();
15358 __struct.integrated_x = buf.get_f32_le();
15359 __struct.integrated_y = buf.get_f32_le();
15360 __struct.integrated_xgyro = buf.get_f32_le();
15361 __struct.integrated_ygyro = buf.get_f32_le();
15362 __struct.integrated_zgyro = buf.get_f32_le();
15363 __struct.time_delta_distance_us = buf.get_u32_le();
15364 __struct.distance = buf.get_f32_le();
15365 __struct.temperature = buf.get_i16_le();
15366 __struct.sensor_id = buf.get_u8();
15367 __struct.quality = buf.get_u8();
15368 Ok(__struct)
15369 }
15370 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15371 let mut __tmp = BytesMut::new(bytes);
15372 #[allow(clippy::absurd_extreme_comparisons)]
15373 #[allow(unused_comparisons)]
15374 if __tmp.remaining() < Self::ENCODED_LEN {
15375 panic!(
15376 "buffer is too small (need {} bytes, but got {})",
15377 Self::ENCODED_LEN,
15378 __tmp.remaining(),
15379 )
15380 }
15381 __tmp.put_u64_le(self.time_usec);
15382 __tmp.put_u32_le(self.integration_time_us);
15383 __tmp.put_f32_le(self.integrated_x);
15384 __tmp.put_f32_le(self.integrated_y);
15385 __tmp.put_f32_le(self.integrated_xgyro);
15386 __tmp.put_f32_le(self.integrated_ygyro);
15387 __tmp.put_f32_le(self.integrated_zgyro);
15388 __tmp.put_u32_le(self.time_delta_distance_us);
15389 __tmp.put_f32_le(self.distance);
15390 __tmp.put_i16_le(self.temperature);
15391 __tmp.put_u8(self.sensor_id);
15392 __tmp.put_u8(self.quality);
15393 if matches!(version, MavlinkVersion::V2) {
15394 let len = __tmp.len();
15395 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15396 } else {
15397 __tmp.len()
15398 }
15399 }
15400}
15401#[doc = "id: 92"]
15402#[doc = "Sent from simulation to autopilot. The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification."]
15403#[derive(Debug, Clone, PartialEq)]
15404#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15405#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15406pub struct HIL_RC_INPUTS_RAW_DATA {
15407 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15408 pub time_usec: u64,
15409 #[doc = "RC channel 1 value"]
15410 pub chan1_raw: u16,
15411 #[doc = "RC channel 2 value"]
15412 pub chan2_raw: u16,
15413 #[doc = "RC channel 3 value"]
15414 pub chan3_raw: u16,
15415 #[doc = "RC channel 4 value"]
15416 pub chan4_raw: u16,
15417 #[doc = "RC channel 5 value"]
15418 pub chan5_raw: u16,
15419 #[doc = "RC channel 6 value"]
15420 pub chan6_raw: u16,
15421 #[doc = "RC channel 7 value"]
15422 pub chan7_raw: u16,
15423 #[doc = "RC channel 8 value"]
15424 pub chan8_raw: u16,
15425 #[doc = "RC channel 9 value"]
15426 pub chan9_raw: u16,
15427 #[doc = "RC channel 10 value"]
15428 pub chan10_raw: u16,
15429 #[doc = "RC channel 11 value"]
15430 pub chan11_raw: u16,
15431 #[doc = "RC channel 12 value"]
15432 pub chan12_raw: u16,
15433 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
15434 pub rssi: u8,
15435}
15436impl HIL_RC_INPUTS_RAW_DATA {
15437 pub const ENCODED_LEN: usize = 33usize;
15438 pub const DEFAULT: Self = Self {
15439 time_usec: 0_u64,
15440 chan1_raw: 0_u16,
15441 chan2_raw: 0_u16,
15442 chan3_raw: 0_u16,
15443 chan4_raw: 0_u16,
15444 chan5_raw: 0_u16,
15445 chan6_raw: 0_u16,
15446 chan7_raw: 0_u16,
15447 chan8_raw: 0_u16,
15448 chan9_raw: 0_u16,
15449 chan10_raw: 0_u16,
15450 chan11_raw: 0_u16,
15451 chan12_raw: 0_u16,
15452 rssi: 0_u8,
15453 };
15454 #[cfg(feature = "arbitrary")]
15455 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15456 use arbitrary::{Arbitrary, Unstructured};
15457 let mut buf = [0u8; 1024];
15458 rng.fill_bytes(&mut buf);
15459 let mut unstructured = Unstructured::new(&buf);
15460 Self::arbitrary(&mut unstructured).unwrap_or_default()
15461 }
15462}
15463impl Default for HIL_RC_INPUTS_RAW_DATA {
15464 fn default() -> Self {
15465 Self::DEFAULT.clone()
15466 }
15467}
15468impl MessageData for HIL_RC_INPUTS_RAW_DATA {
15469 type Message = MavMessage;
15470 const ID: u32 = 92u32;
15471 const NAME: &'static str = "HIL_RC_INPUTS_RAW";
15472 const EXTRA_CRC: u8 = 54u8;
15473 const ENCODED_LEN: usize = 33usize;
15474 fn deser(
15475 _version: MavlinkVersion,
15476 __input: &[u8],
15477 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15478 let avail_len = __input.len();
15479 let mut payload_buf = [0; Self::ENCODED_LEN];
15480 let mut buf = if avail_len < Self::ENCODED_LEN {
15481 payload_buf[0..avail_len].copy_from_slice(__input);
15482 Bytes::new(&payload_buf)
15483 } else {
15484 Bytes::new(__input)
15485 };
15486 let mut __struct = Self::default();
15487 __struct.time_usec = buf.get_u64_le();
15488 __struct.chan1_raw = buf.get_u16_le();
15489 __struct.chan2_raw = buf.get_u16_le();
15490 __struct.chan3_raw = buf.get_u16_le();
15491 __struct.chan4_raw = buf.get_u16_le();
15492 __struct.chan5_raw = buf.get_u16_le();
15493 __struct.chan6_raw = buf.get_u16_le();
15494 __struct.chan7_raw = buf.get_u16_le();
15495 __struct.chan8_raw = buf.get_u16_le();
15496 __struct.chan9_raw = buf.get_u16_le();
15497 __struct.chan10_raw = buf.get_u16_le();
15498 __struct.chan11_raw = buf.get_u16_le();
15499 __struct.chan12_raw = buf.get_u16_le();
15500 __struct.rssi = buf.get_u8();
15501 Ok(__struct)
15502 }
15503 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15504 let mut __tmp = BytesMut::new(bytes);
15505 #[allow(clippy::absurd_extreme_comparisons)]
15506 #[allow(unused_comparisons)]
15507 if __tmp.remaining() < Self::ENCODED_LEN {
15508 panic!(
15509 "buffer is too small (need {} bytes, but got {})",
15510 Self::ENCODED_LEN,
15511 __tmp.remaining(),
15512 )
15513 }
15514 __tmp.put_u64_le(self.time_usec);
15515 __tmp.put_u16_le(self.chan1_raw);
15516 __tmp.put_u16_le(self.chan2_raw);
15517 __tmp.put_u16_le(self.chan3_raw);
15518 __tmp.put_u16_le(self.chan4_raw);
15519 __tmp.put_u16_le(self.chan5_raw);
15520 __tmp.put_u16_le(self.chan6_raw);
15521 __tmp.put_u16_le(self.chan7_raw);
15522 __tmp.put_u16_le(self.chan8_raw);
15523 __tmp.put_u16_le(self.chan9_raw);
15524 __tmp.put_u16_le(self.chan10_raw);
15525 __tmp.put_u16_le(self.chan11_raw);
15526 __tmp.put_u16_le(self.chan12_raw);
15527 __tmp.put_u8(self.rssi);
15528 if matches!(version, MavlinkVersion::V2) {
15529 let len = __tmp.len();
15530 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15531 } else {
15532 __tmp.len()
15533 }
15534 }
15535}
15536#[doc = "id: 107"]
15537#[doc = "The IMU readings in SI units in NED body frame."]
15538#[derive(Debug, Clone, PartialEq)]
15539#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15540#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15541pub struct HIL_SENSOR_DATA {
15542 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15543 pub time_usec: u64,
15544 #[doc = "X acceleration"]
15545 pub xacc: f32,
15546 #[doc = "Y acceleration"]
15547 pub yacc: f32,
15548 #[doc = "Z acceleration"]
15549 pub zacc: f32,
15550 #[doc = "Angular speed around X axis in body frame"]
15551 pub xgyro: f32,
15552 #[doc = "Angular speed around Y axis in body frame"]
15553 pub ygyro: f32,
15554 #[doc = "Angular speed around Z axis in body frame"]
15555 pub zgyro: f32,
15556 #[doc = "X Magnetic field"]
15557 pub xmag: f32,
15558 #[doc = "Y Magnetic field"]
15559 pub ymag: f32,
15560 #[doc = "Z Magnetic field"]
15561 pub zmag: f32,
15562 #[doc = "Absolute pressure"]
15563 pub abs_pressure: f32,
15564 #[doc = "Differential pressure (airspeed)"]
15565 pub diff_pressure: f32,
15566 #[doc = "Altitude calculated from pressure"]
15567 pub pressure_alt: f32,
15568 #[doc = "Temperature"]
15569 pub temperature: f32,
15570 #[doc = "Bitmap for fields that have updated since last message"]
15571 pub fields_updated: HilSensorUpdatedFlags,
15572 #[doc = "Sensor ID (zero indexed). Used for multiple sensor inputs"]
15573 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
15574 pub id: u8,
15575}
15576impl HIL_SENSOR_DATA {
15577 pub const ENCODED_LEN: usize = 65usize;
15578 pub const DEFAULT: Self = Self {
15579 time_usec: 0_u64,
15580 xacc: 0.0_f32,
15581 yacc: 0.0_f32,
15582 zacc: 0.0_f32,
15583 xgyro: 0.0_f32,
15584 ygyro: 0.0_f32,
15585 zgyro: 0.0_f32,
15586 xmag: 0.0_f32,
15587 ymag: 0.0_f32,
15588 zmag: 0.0_f32,
15589 abs_pressure: 0.0_f32,
15590 diff_pressure: 0.0_f32,
15591 pressure_alt: 0.0_f32,
15592 temperature: 0.0_f32,
15593 fields_updated: HilSensorUpdatedFlags::DEFAULT,
15594 id: 0_u8,
15595 };
15596 #[cfg(feature = "arbitrary")]
15597 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15598 use arbitrary::{Arbitrary, Unstructured};
15599 let mut buf = [0u8; 1024];
15600 rng.fill_bytes(&mut buf);
15601 let mut unstructured = Unstructured::new(&buf);
15602 Self::arbitrary(&mut unstructured).unwrap_or_default()
15603 }
15604}
15605impl Default for HIL_SENSOR_DATA {
15606 fn default() -> Self {
15607 Self::DEFAULT.clone()
15608 }
15609}
15610impl MessageData for HIL_SENSOR_DATA {
15611 type Message = MavMessage;
15612 const ID: u32 = 107u32;
15613 const NAME: &'static str = "HIL_SENSOR";
15614 const EXTRA_CRC: u8 = 108u8;
15615 const ENCODED_LEN: usize = 65usize;
15616 fn deser(
15617 _version: MavlinkVersion,
15618 __input: &[u8],
15619 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15620 let avail_len = __input.len();
15621 let mut payload_buf = [0; Self::ENCODED_LEN];
15622 let mut buf = if avail_len < Self::ENCODED_LEN {
15623 payload_buf[0..avail_len].copy_from_slice(__input);
15624 Bytes::new(&payload_buf)
15625 } else {
15626 Bytes::new(__input)
15627 };
15628 let mut __struct = Self::default();
15629 __struct.time_usec = buf.get_u64_le();
15630 __struct.xacc = buf.get_f32_le();
15631 __struct.yacc = buf.get_f32_le();
15632 __struct.zacc = buf.get_f32_le();
15633 __struct.xgyro = buf.get_f32_le();
15634 __struct.ygyro = buf.get_f32_le();
15635 __struct.zgyro = buf.get_f32_le();
15636 __struct.xmag = buf.get_f32_le();
15637 __struct.ymag = buf.get_f32_le();
15638 __struct.zmag = buf.get_f32_le();
15639 __struct.abs_pressure = buf.get_f32_le();
15640 __struct.diff_pressure = buf.get_f32_le();
15641 __struct.pressure_alt = buf.get_f32_le();
15642 __struct.temperature = buf.get_f32_le();
15643 let tmp = buf.get_u32_le();
15644 __struct.fields_updated = HilSensorUpdatedFlags::from_bits(
15645 tmp & HilSensorUpdatedFlags::all().bits(),
15646 )
15647 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
15648 flag_type: "HilSensorUpdatedFlags",
15649 value: tmp as u32,
15650 })?;
15651 __struct.id = buf.get_u8();
15652 Ok(__struct)
15653 }
15654 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15655 let mut __tmp = BytesMut::new(bytes);
15656 #[allow(clippy::absurd_extreme_comparisons)]
15657 #[allow(unused_comparisons)]
15658 if __tmp.remaining() < Self::ENCODED_LEN {
15659 panic!(
15660 "buffer is too small (need {} bytes, but got {})",
15661 Self::ENCODED_LEN,
15662 __tmp.remaining(),
15663 )
15664 }
15665 __tmp.put_u64_le(self.time_usec);
15666 __tmp.put_f32_le(self.xacc);
15667 __tmp.put_f32_le(self.yacc);
15668 __tmp.put_f32_le(self.zacc);
15669 __tmp.put_f32_le(self.xgyro);
15670 __tmp.put_f32_le(self.ygyro);
15671 __tmp.put_f32_le(self.zgyro);
15672 __tmp.put_f32_le(self.xmag);
15673 __tmp.put_f32_le(self.ymag);
15674 __tmp.put_f32_le(self.zmag);
15675 __tmp.put_f32_le(self.abs_pressure);
15676 __tmp.put_f32_le(self.diff_pressure);
15677 __tmp.put_f32_le(self.pressure_alt);
15678 __tmp.put_f32_le(self.temperature);
15679 __tmp.put_u32_le(self.fields_updated.bits());
15680 __tmp.put_u8(self.id);
15681 if matches!(version, MavlinkVersion::V2) {
15682 let len = __tmp.len();
15683 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15684 } else {
15685 __tmp.len()
15686 }
15687 }
15688}
15689#[deprecated = "Suffers from missing airspeed fields and singularities due to Euler angles. See `HIL_STATE_QUATERNION` (Deprecated since 2013-07)"]
15690#[doc = "id: 90"]
15691#[doc = "Sent from simulation to autopilot. This packet is useful for high throughput applications such as hardware in the loop simulations."]
15692#[derive(Debug, Clone, PartialEq)]
15693#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15694#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15695pub struct HIL_STATE_DATA {
15696 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15697 pub time_usec: u64,
15698 #[doc = "Roll angle"]
15699 pub roll: f32,
15700 #[doc = "Pitch angle"]
15701 pub pitch: f32,
15702 #[doc = "Yaw angle"]
15703 pub yaw: f32,
15704 #[doc = "Body frame roll / phi angular speed"]
15705 pub rollspeed: f32,
15706 #[doc = "Body frame pitch / theta angular speed"]
15707 pub pitchspeed: f32,
15708 #[doc = "Body frame yaw / psi angular speed"]
15709 pub yawspeed: f32,
15710 #[doc = "Latitude"]
15711 pub lat: i32,
15712 #[doc = "Longitude"]
15713 pub lon: i32,
15714 #[doc = "Altitude"]
15715 pub alt: i32,
15716 #[doc = "Ground X Speed (Latitude)"]
15717 pub vx: i16,
15718 #[doc = "Ground Y Speed (Longitude)"]
15719 pub vy: i16,
15720 #[doc = "Ground Z Speed (Altitude)"]
15721 pub vz: i16,
15722 #[doc = "X acceleration"]
15723 pub xacc: i16,
15724 #[doc = "Y acceleration"]
15725 pub yacc: i16,
15726 #[doc = "Z acceleration"]
15727 pub zacc: i16,
15728}
15729impl HIL_STATE_DATA {
15730 pub const ENCODED_LEN: usize = 56usize;
15731 pub const DEFAULT: Self = Self {
15732 time_usec: 0_u64,
15733 roll: 0.0_f32,
15734 pitch: 0.0_f32,
15735 yaw: 0.0_f32,
15736 rollspeed: 0.0_f32,
15737 pitchspeed: 0.0_f32,
15738 yawspeed: 0.0_f32,
15739 lat: 0_i32,
15740 lon: 0_i32,
15741 alt: 0_i32,
15742 vx: 0_i16,
15743 vy: 0_i16,
15744 vz: 0_i16,
15745 xacc: 0_i16,
15746 yacc: 0_i16,
15747 zacc: 0_i16,
15748 };
15749 #[cfg(feature = "arbitrary")]
15750 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15751 use arbitrary::{Arbitrary, Unstructured};
15752 let mut buf = [0u8; 1024];
15753 rng.fill_bytes(&mut buf);
15754 let mut unstructured = Unstructured::new(&buf);
15755 Self::arbitrary(&mut unstructured).unwrap_or_default()
15756 }
15757}
15758impl Default for HIL_STATE_DATA {
15759 fn default() -> Self {
15760 Self::DEFAULT.clone()
15761 }
15762}
15763impl MessageData for HIL_STATE_DATA {
15764 type Message = MavMessage;
15765 const ID: u32 = 90u32;
15766 const NAME: &'static str = "HIL_STATE";
15767 const EXTRA_CRC: u8 = 183u8;
15768 const ENCODED_LEN: usize = 56usize;
15769 fn deser(
15770 _version: MavlinkVersion,
15771 __input: &[u8],
15772 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15773 let avail_len = __input.len();
15774 let mut payload_buf = [0; Self::ENCODED_LEN];
15775 let mut buf = if avail_len < Self::ENCODED_LEN {
15776 payload_buf[0..avail_len].copy_from_slice(__input);
15777 Bytes::new(&payload_buf)
15778 } else {
15779 Bytes::new(__input)
15780 };
15781 let mut __struct = Self::default();
15782 __struct.time_usec = buf.get_u64_le();
15783 __struct.roll = buf.get_f32_le();
15784 __struct.pitch = buf.get_f32_le();
15785 __struct.yaw = buf.get_f32_le();
15786 __struct.rollspeed = buf.get_f32_le();
15787 __struct.pitchspeed = buf.get_f32_le();
15788 __struct.yawspeed = buf.get_f32_le();
15789 __struct.lat = buf.get_i32_le();
15790 __struct.lon = buf.get_i32_le();
15791 __struct.alt = buf.get_i32_le();
15792 __struct.vx = buf.get_i16_le();
15793 __struct.vy = buf.get_i16_le();
15794 __struct.vz = buf.get_i16_le();
15795 __struct.xacc = buf.get_i16_le();
15796 __struct.yacc = buf.get_i16_le();
15797 __struct.zacc = buf.get_i16_le();
15798 Ok(__struct)
15799 }
15800 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15801 let mut __tmp = BytesMut::new(bytes);
15802 #[allow(clippy::absurd_extreme_comparisons)]
15803 #[allow(unused_comparisons)]
15804 if __tmp.remaining() < Self::ENCODED_LEN {
15805 panic!(
15806 "buffer is too small (need {} bytes, but got {})",
15807 Self::ENCODED_LEN,
15808 __tmp.remaining(),
15809 )
15810 }
15811 __tmp.put_u64_le(self.time_usec);
15812 __tmp.put_f32_le(self.roll);
15813 __tmp.put_f32_le(self.pitch);
15814 __tmp.put_f32_le(self.yaw);
15815 __tmp.put_f32_le(self.rollspeed);
15816 __tmp.put_f32_le(self.pitchspeed);
15817 __tmp.put_f32_le(self.yawspeed);
15818 __tmp.put_i32_le(self.lat);
15819 __tmp.put_i32_le(self.lon);
15820 __tmp.put_i32_le(self.alt);
15821 __tmp.put_i16_le(self.vx);
15822 __tmp.put_i16_le(self.vy);
15823 __tmp.put_i16_le(self.vz);
15824 __tmp.put_i16_le(self.xacc);
15825 __tmp.put_i16_le(self.yacc);
15826 __tmp.put_i16_le(self.zacc);
15827 if matches!(version, MavlinkVersion::V2) {
15828 let len = __tmp.len();
15829 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15830 } else {
15831 __tmp.len()
15832 }
15833 }
15834}
15835#[doc = "id: 115"]
15836#[doc = "Sent from simulation to autopilot, avoids in contrast to HIL_STATE singularities. This packet is useful for high throughput applications such as hardware in the loop simulations."]
15837#[derive(Debug, Clone, PartialEq)]
15838#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15839#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15840pub struct HIL_STATE_QUATERNION_DATA {
15841 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15842 pub time_usec: u64,
15843 #[doc = "Vehicle attitude expressed as normalized quaternion in w, x, y, z order (with 1 0 0 0 being the null-rotation)"]
15844 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15845 pub attitude_quaternion: [f32; 4],
15846 #[doc = "Body frame roll / phi angular speed"]
15847 pub rollspeed: f32,
15848 #[doc = "Body frame pitch / theta angular speed"]
15849 pub pitchspeed: f32,
15850 #[doc = "Body frame yaw / psi angular speed"]
15851 pub yawspeed: f32,
15852 #[doc = "Latitude"]
15853 pub lat: i32,
15854 #[doc = "Longitude"]
15855 pub lon: i32,
15856 #[doc = "Altitude"]
15857 pub alt: i32,
15858 #[doc = "Ground X Speed (Latitude)"]
15859 pub vx: i16,
15860 #[doc = "Ground Y Speed (Longitude)"]
15861 pub vy: i16,
15862 #[doc = "Ground Z Speed (Altitude)"]
15863 pub vz: i16,
15864 #[doc = "Indicated airspeed"]
15865 pub ind_airspeed: u16,
15866 #[doc = "True airspeed"]
15867 pub true_airspeed: u16,
15868 #[doc = "X acceleration"]
15869 pub xacc: i16,
15870 #[doc = "Y acceleration"]
15871 pub yacc: i16,
15872 #[doc = "Z acceleration"]
15873 pub zacc: i16,
15874}
15875impl HIL_STATE_QUATERNION_DATA {
15876 pub const ENCODED_LEN: usize = 64usize;
15877 pub const DEFAULT: Self = Self {
15878 time_usec: 0_u64,
15879 attitude_quaternion: [0.0_f32; 4usize],
15880 rollspeed: 0.0_f32,
15881 pitchspeed: 0.0_f32,
15882 yawspeed: 0.0_f32,
15883 lat: 0_i32,
15884 lon: 0_i32,
15885 alt: 0_i32,
15886 vx: 0_i16,
15887 vy: 0_i16,
15888 vz: 0_i16,
15889 ind_airspeed: 0_u16,
15890 true_airspeed: 0_u16,
15891 xacc: 0_i16,
15892 yacc: 0_i16,
15893 zacc: 0_i16,
15894 };
15895 #[cfg(feature = "arbitrary")]
15896 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15897 use arbitrary::{Arbitrary, Unstructured};
15898 let mut buf = [0u8; 1024];
15899 rng.fill_bytes(&mut buf);
15900 let mut unstructured = Unstructured::new(&buf);
15901 Self::arbitrary(&mut unstructured).unwrap_or_default()
15902 }
15903}
15904impl Default for HIL_STATE_QUATERNION_DATA {
15905 fn default() -> Self {
15906 Self::DEFAULT.clone()
15907 }
15908}
15909impl MessageData for HIL_STATE_QUATERNION_DATA {
15910 type Message = MavMessage;
15911 const ID: u32 = 115u32;
15912 const NAME: &'static str = "HIL_STATE_QUATERNION";
15913 const EXTRA_CRC: u8 = 4u8;
15914 const ENCODED_LEN: usize = 64usize;
15915 fn deser(
15916 _version: MavlinkVersion,
15917 __input: &[u8],
15918 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15919 let avail_len = __input.len();
15920 let mut payload_buf = [0; Self::ENCODED_LEN];
15921 let mut buf = if avail_len < Self::ENCODED_LEN {
15922 payload_buf[0..avail_len].copy_from_slice(__input);
15923 Bytes::new(&payload_buf)
15924 } else {
15925 Bytes::new(__input)
15926 };
15927 let mut __struct = Self::default();
15928 __struct.time_usec = buf.get_u64_le();
15929 for v in &mut __struct.attitude_quaternion {
15930 let val = buf.get_f32_le();
15931 *v = val;
15932 }
15933 __struct.rollspeed = buf.get_f32_le();
15934 __struct.pitchspeed = buf.get_f32_le();
15935 __struct.yawspeed = buf.get_f32_le();
15936 __struct.lat = buf.get_i32_le();
15937 __struct.lon = buf.get_i32_le();
15938 __struct.alt = buf.get_i32_le();
15939 __struct.vx = buf.get_i16_le();
15940 __struct.vy = buf.get_i16_le();
15941 __struct.vz = buf.get_i16_le();
15942 __struct.ind_airspeed = buf.get_u16_le();
15943 __struct.true_airspeed = buf.get_u16_le();
15944 __struct.xacc = buf.get_i16_le();
15945 __struct.yacc = buf.get_i16_le();
15946 __struct.zacc = buf.get_i16_le();
15947 Ok(__struct)
15948 }
15949 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15950 let mut __tmp = BytesMut::new(bytes);
15951 #[allow(clippy::absurd_extreme_comparisons)]
15952 #[allow(unused_comparisons)]
15953 if __tmp.remaining() < Self::ENCODED_LEN {
15954 panic!(
15955 "buffer is too small (need {} bytes, but got {})",
15956 Self::ENCODED_LEN,
15957 __tmp.remaining(),
15958 )
15959 }
15960 __tmp.put_u64_le(self.time_usec);
15961 for val in &self.attitude_quaternion {
15962 __tmp.put_f32_le(*val);
15963 }
15964 __tmp.put_f32_le(self.rollspeed);
15965 __tmp.put_f32_le(self.pitchspeed);
15966 __tmp.put_f32_le(self.yawspeed);
15967 __tmp.put_i32_le(self.lat);
15968 __tmp.put_i32_le(self.lon);
15969 __tmp.put_i32_le(self.alt);
15970 __tmp.put_i16_le(self.vx);
15971 __tmp.put_i16_le(self.vy);
15972 __tmp.put_i16_le(self.vz);
15973 __tmp.put_u16_le(self.ind_airspeed);
15974 __tmp.put_u16_le(self.true_airspeed);
15975 __tmp.put_i16_le(self.xacc);
15976 __tmp.put_i16_le(self.yacc);
15977 __tmp.put_i16_le(self.zacc);
15978 if matches!(version, MavlinkVersion::V2) {
15979 let len = __tmp.len();
15980 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15981 } else {
15982 __tmp.len()
15983 }
15984 }
15985}
15986#[doc = "id: 242"]
15987#[doc = "Contains the home position. \tThe home position is the default position that the system will return to and land on. \tThe position must be set automatically by the system during the takeoff, and may also be explicitly set using MAV_CMD_DO_SET_HOME. \tThe global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. \tUnder normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. \tThe approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. Note: this message can be requested by sending the MAV_CMD_REQUEST_MESSAGE with param1=242 (or the deprecated MAV_CMD_GET_HOME_POSITION command)."]
15988#[derive(Debug, Clone, PartialEq)]
15989#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15990#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15991pub struct HOME_POSITION_DATA {
15992 #[doc = "Latitude (WGS84)"]
15993 pub latitude: i32,
15994 #[doc = "Longitude (WGS84)"]
15995 pub longitude: i32,
15996 #[doc = "Altitude (MSL). Positive for up."]
15997 pub altitude: i32,
15998 #[doc = "Local X position of this position in the local coordinate frame (NED)"]
15999 pub x: f32,
16000 #[doc = "Local Y position of this position in the local coordinate frame (NED)"]
16001 pub y: f32,
16002 #[doc = "Local Z position of this position in the local coordinate frame (NED: positive \"down\")"]
16003 pub z: f32,
16004 #[doc = "Quaternion indicating world-to-surface-normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground. All fields should be set to NaN if an accurate quaternion for both heading and surface slope cannot be supplied."]
16005 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
16006 pub q: [f32; 4],
16007 #[doc = "Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
16008 pub approach_x: f32,
16009 #[doc = "Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
16010 pub approach_y: f32,
16011 #[doc = "Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
16012 pub approach_z: f32,
16013 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16014 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
16015 pub time_usec: u64,
16016}
16017impl HOME_POSITION_DATA {
16018 pub const ENCODED_LEN: usize = 60usize;
16019 pub const DEFAULT: Self = Self {
16020 latitude: 0_i32,
16021 longitude: 0_i32,
16022 altitude: 0_i32,
16023 x: 0.0_f32,
16024 y: 0.0_f32,
16025 z: 0.0_f32,
16026 q: [0.0_f32; 4usize],
16027 approach_x: 0.0_f32,
16028 approach_y: 0.0_f32,
16029 approach_z: 0.0_f32,
16030 time_usec: 0_u64,
16031 };
16032 #[cfg(feature = "arbitrary")]
16033 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16034 use arbitrary::{Arbitrary, Unstructured};
16035 let mut buf = [0u8; 1024];
16036 rng.fill_bytes(&mut buf);
16037 let mut unstructured = Unstructured::new(&buf);
16038 Self::arbitrary(&mut unstructured).unwrap_or_default()
16039 }
16040}
16041impl Default for HOME_POSITION_DATA {
16042 fn default() -> Self {
16043 Self::DEFAULT.clone()
16044 }
16045}
16046impl MessageData for HOME_POSITION_DATA {
16047 type Message = MavMessage;
16048 const ID: u32 = 242u32;
16049 const NAME: &'static str = "HOME_POSITION";
16050 const EXTRA_CRC: u8 = 104u8;
16051 const ENCODED_LEN: usize = 60usize;
16052 fn deser(
16053 _version: MavlinkVersion,
16054 __input: &[u8],
16055 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16056 let avail_len = __input.len();
16057 let mut payload_buf = [0; Self::ENCODED_LEN];
16058 let mut buf = if avail_len < Self::ENCODED_LEN {
16059 payload_buf[0..avail_len].copy_from_slice(__input);
16060 Bytes::new(&payload_buf)
16061 } else {
16062 Bytes::new(__input)
16063 };
16064 let mut __struct = Self::default();
16065 __struct.latitude = buf.get_i32_le();
16066 __struct.longitude = buf.get_i32_le();
16067 __struct.altitude = buf.get_i32_le();
16068 __struct.x = buf.get_f32_le();
16069 __struct.y = buf.get_f32_le();
16070 __struct.z = buf.get_f32_le();
16071 for v in &mut __struct.q {
16072 let val = buf.get_f32_le();
16073 *v = val;
16074 }
16075 __struct.approach_x = buf.get_f32_le();
16076 __struct.approach_y = buf.get_f32_le();
16077 __struct.approach_z = buf.get_f32_le();
16078 __struct.time_usec = buf.get_u64_le();
16079 Ok(__struct)
16080 }
16081 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16082 let mut __tmp = BytesMut::new(bytes);
16083 #[allow(clippy::absurd_extreme_comparisons)]
16084 #[allow(unused_comparisons)]
16085 if __tmp.remaining() < Self::ENCODED_LEN {
16086 panic!(
16087 "buffer is too small (need {} bytes, but got {})",
16088 Self::ENCODED_LEN,
16089 __tmp.remaining(),
16090 )
16091 }
16092 __tmp.put_i32_le(self.latitude);
16093 __tmp.put_i32_le(self.longitude);
16094 __tmp.put_i32_le(self.altitude);
16095 __tmp.put_f32_le(self.x);
16096 __tmp.put_f32_le(self.y);
16097 __tmp.put_f32_le(self.z);
16098 for val in &self.q {
16099 __tmp.put_f32_le(*val);
16100 }
16101 __tmp.put_f32_le(self.approach_x);
16102 __tmp.put_f32_le(self.approach_y);
16103 __tmp.put_f32_le(self.approach_z);
16104 __tmp.put_u64_le(self.time_usec);
16105 if matches!(version, MavlinkVersion::V2) {
16106 let len = __tmp.len();
16107 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16108 } else {
16109 __tmp.len()
16110 }
16111 }
16112}
16113#[doc = "id: 12920"]
16114#[doc = "Temperature and humidity from hygrometer."]
16115#[derive(Debug, Clone, PartialEq)]
16116#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16117#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16118pub struct HYGROMETER_SENSOR_DATA {
16119 #[doc = "Temperature"]
16120 pub temperature: i16,
16121 #[doc = "Humidity"]
16122 pub humidity: u16,
16123 #[doc = "Hygrometer ID"]
16124 pub id: u8,
16125}
16126impl HYGROMETER_SENSOR_DATA {
16127 pub const ENCODED_LEN: usize = 5usize;
16128 pub const DEFAULT: Self = Self {
16129 temperature: 0_i16,
16130 humidity: 0_u16,
16131 id: 0_u8,
16132 };
16133 #[cfg(feature = "arbitrary")]
16134 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16135 use arbitrary::{Arbitrary, Unstructured};
16136 let mut buf = [0u8; 1024];
16137 rng.fill_bytes(&mut buf);
16138 let mut unstructured = Unstructured::new(&buf);
16139 Self::arbitrary(&mut unstructured).unwrap_or_default()
16140 }
16141}
16142impl Default for HYGROMETER_SENSOR_DATA {
16143 fn default() -> Self {
16144 Self::DEFAULT.clone()
16145 }
16146}
16147impl MessageData for HYGROMETER_SENSOR_DATA {
16148 type Message = MavMessage;
16149 const ID: u32 = 12920u32;
16150 const NAME: &'static str = "HYGROMETER_SENSOR";
16151 const EXTRA_CRC: u8 = 20u8;
16152 const ENCODED_LEN: usize = 5usize;
16153 fn deser(
16154 _version: MavlinkVersion,
16155 __input: &[u8],
16156 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16157 let avail_len = __input.len();
16158 let mut payload_buf = [0; Self::ENCODED_LEN];
16159 let mut buf = if avail_len < Self::ENCODED_LEN {
16160 payload_buf[0..avail_len].copy_from_slice(__input);
16161 Bytes::new(&payload_buf)
16162 } else {
16163 Bytes::new(__input)
16164 };
16165 let mut __struct = Self::default();
16166 __struct.temperature = buf.get_i16_le();
16167 __struct.humidity = buf.get_u16_le();
16168 __struct.id = buf.get_u8();
16169 Ok(__struct)
16170 }
16171 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16172 let mut __tmp = BytesMut::new(bytes);
16173 #[allow(clippy::absurd_extreme_comparisons)]
16174 #[allow(unused_comparisons)]
16175 if __tmp.remaining() < Self::ENCODED_LEN {
16176 panic!(
16177 "buffer is too small (need {} bytes, but got {})",
16178 Self::ENCODED_LEN,
16179 __tmp.remaining(),
16180 )
16181 }
16182 __tmp.put_i16_le(self.temperature);
16183 __tmp.put_u16_le(self.humidity);
16184 __tmp.put_u8(self.id);
16185 if matches!(version, MavlinkVersion::V2) {
16186 let len = __tmp.len();
16187 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16188 } else {
16189 __tmp.len()
16190 }
16191 }
16192}
16193#[doc = "id: 440"]
16194#[doc = "Illuminator status."]
16195#[derive(Debug, Clone, PartialEq)]
16196#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16197#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16198pub struct ILLUMINATOR_STATUS_DATA {
16199 #[doc = "Time since the start-up of the illuminator in ms"]
16200 pub uptime_ms: u32,
16201 #[doc = "Errors"]
16202 pub error_status: IlluminatorErrorFlags,
16203 #[doc = "Illuminator brightness"]
16204 pub brightness: f32,
16205 #[doc = "Illuminator strobing period in seconds"]
16206 pub strobe_period: f32,
16207 #[doc = "Illuminator strobing duty cycle"]
16208 pub strobe_duty_cycle: f32,
16209 #[doc = "Temperature in Celsius"]
16210 pub temp_c: f32,
16211 #[doc = "Minimum strobing period in seconds"]
16212 pub min_strobe_period: f32,
16213 #[doc = "Maximum strobing period in seconds"]
16214 pub max_strobe_period: f32,
16215 #[doc = "0: Illuminators OFF, 1: Illuminators ON"]
16216 pub enable: u8,
16217 #[doc = "Supported illuminator modes"]
16218 pub mode_bitmask: IlluminatorMode,
16219 #[doc = "Illuminator mode"]
16220 pub mode: IlluminatorMode,
16221}
16222impl ILLUMINATOR_STATUS_DATA {
16223 pub const ENCODED_LEN: usize = 35usize;
16224 pub const DEFAULT: Self = Self {
16225 uptime_ms: 0_u32,
16226 error_status: IlluminatorErrorFlags::DEFAULT,
16227 brightness: 0.0_f32,
16228 strobe_period: 0.0_f32,
16229 strobe_duty_cycle: 0.0_f32,
16230 temp_c: 0.0_f32,
16231 min_strobe_period: 0.0_f32,
16232 max_strobe_period: 0.0_f32,
16233 enable: 0_u8,
16234 mode_bitmask: IlluminatorMode::DEFAULT,
16235 mode: IlluminatorMode::DEFAULT,
16236 };
16237 #[cfg(feature = "arbitrary")]
16238 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16239 use arbitrary::{Arbitrary, Unstructured};
16240 let mut buf = [0u8; 1024];
16241 rng.fill_bytes(&mut buf);
16242 let mut unstructured = Unstructured::new(&buf);
16243 Self::arbitrary(&mut unstructured).unwrap_or_default()
16244 }
16245}
16246impl Default for ILLUMINATOR_STATUS_DATA {
16247 fn default() -> Self {
16248 Self::DEFAULT.clone()
16249 }
16250}
16251impl MessageData for ILLUMINATOR_STATUS_DATA {
16252 type Message = MavMessage;
16253 const ID: u32 = 440u32;
16254 const NAME: &'static str = "ILLUMINATOR_STATUS";
16255 const EXTRA_CRC: u8 = 66u8;
16256 const ENCODED_LEN: usize = 35usize;
16257 fn deser(
16258 _version: MavlinkVersion,
16259 __input: &[u8],
16260 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16261 let avail_len = __input.len();
16262 let mut payload_buf = [0; Self::ENCODED_LEN];
16263 let mut buf = if avail_len < Self::ENCODED_LEN {
16264 payload_buf[0..avail_len].copy_from_slice(__input);
16265 Bytes::new(&payload_buf)
16266 } else {
16267 Bytes::new(__input)
16268 };
16269 let mut __struct = Self::default();
16270 __struct.uptime_ms = buf.get_u32_le();
16271 let tmp = buf.get_u32_le();
16272 __struct.error_status = IlluminatorErrorFlags::from_bits(
16273 tmp & IlluminatorErrorFlags::all().bits(),
16274 )
16275 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
16276 flag_type: "IlluminatorErrorFlags",
16277 value: tmp as u32,
16278 })?;
16279 __struct.brightness = buf.get_f32_le();
16280 __struct.strobe_period = buf.get_f32_le();
16281 __struct.strobe_duty_cycle = buf.get_f32_le();
16282 __struct.temp_c = buf.get_f32_le();
16283 __struct.min_strobe_period = buf.get_f32_le();
16284 __struct.max_strobe_period = buf.get_f32_le();
16285 __struct.enable = buf.get_u8();
16286 let tmp = buf.get_u8();
16287 __struct.mode_bitmask =
16288 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
16289 enum_type: "IlluminatorMode",
16290 value: tmp as u32,
16291 })?;
16292 let tmp = buf.get_u8();
16293 __struct.mode =
16294 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
16295 enum_type: "IlluminatorMode",
16296 value: tmp as u32,
16297 })?;
16298 Ok(__struct)
16299 }
16300 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16301 let mut __tmp = BytesMut::new(bytes);
16302 #[allow(clippy::absurd_extreme_comparisons)]
16303 #[allow(unused_comparisons)]
16304 if __tmp.remaining() < Self::ENCODED_LEN {
16305 panic!(
16306 "buffer is too small (need {} bytes, but got {})",
16307 Self::ENCODED_LEN,
16308 __tmp.remaining(),
16309 )
16310 }
16311 __tmp.put_u32_le(self.uptime_ms);
16312 __tmp.put_u32_le(self.error_status.bits());
16313 __tmp.put_f32_le(self.brightness);
16314 __tmp.put_f32_le(self.strobe_period);
16315 __tmp.put_f32_le(self.strobe_duty_cycle);
16316 __tmp.put_f32_le(self.temp_c);
16317 __tmp.put_f32_le(self.min_strobe_period);
16318 __tmp.put_f32_le(self.max_strobe_period);
16319 __tmp.put_u8(self.enable);
16320 __tmp.put_u8(self.mode_bitmask as u8);
16321 __tmp.put_u8(self.mode as u8);
16322 if matches!(version, MavlinkVersion::V2) {
16323 let len = __tmp.len();
16324 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16325 } else {
16326 __tmp.len()
16327 }
16328 }
16329}
16330#[doc = "id: 335"]
16331#[doc = "Status of the Iridium SBD link."]
16332#[derive(Debug, Clone, PartialEq)]
16333#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16334#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16335pub struct ISBD_LINK_STATUS_DATA {
16336 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16337 pub timestamp: u64,
16338 #[doc = "Timestamp of the last successful sbd session. The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16339 pub last_heartbeat: u64,
16340 #[doc = "Number of failed SBD sessions."]
16341 pub failed_sessions: u16,
16342 #[doc = "Number of successful SBD sessions."]
16343 pub successful_sessions: u16,
16344 #[doc = "Signal quality equal to the number of bars displayed on the ISU signal strength indicator. Range is 0 to 5, where 0 indicates no signal and 5 indicates maximum signal strength."]
16345 pub signal_quality: u8,
16346 #[doc = "1: Ring call pending, 0: No call pending."]
16347 pub ring_pending: u8,
16348 #[doc = "1: Transmission session pending, 0: No transmission session pending."]
16349 pub tx_session_pending: u8,
16350 #[doc = "1: Receiving session pending, 0: No receiving session pending."]
16351 pub rx_session_pending: u8,
16352}
16353impl ISBD_LINK_STATUS_DATA {
16354 pub const ENCODED_LEN: usize = 24usize;
16355 pub const DEFAULT: Self = Self {
16356 timestamp: 0_u64,
16357 last_heartbeat: 0_u64,
16358 failed_sessions: 0_u16,
16359 successful_sessions: 0_u16,
16360 signal_quality: 0_u8,
16361 ring_pending: 0_u8,
16362 tx_session_pending: 0_u8,
16363 rx_session_pending: 0_u8,
16364 };
16365 #[cfg(feature = "arbitrary")]
16366 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16367 use arbitrary::{Arbitrary, Unstructured};
16368 let mut buf = [0u8; 1024];
16369 rng.fill_bytes(&mut buf);
16370 let mut unstructured = Unstructured::new(&buf);
16371 Self::arbitrary(&mut unstructured).unwrap_or_default()
16372 }
16373}
16374impl Default for ISBD_LINK_STATUS_DATA {
16375 fn default() -> Self {
16376 Self::DEFAULT.clone()
16377 }
16378}
16379impl MessageData for ISBD_LINK_STATUS_DATA {
16380 type Message = MavMessage;
16381 const ID: u32 = 335u32;
16382 const NAME: &'static str = "ISBD_LINK_STATUS";
16383 const EXTRA_CRC: u8 = 225u8;
16384 const ENCODED_LEN: usize = 24usize;
16385 fn deser(
16386 _version: MavlinkVersion,
16387 __input: &[u8],
16388 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16389 let avail_len = __input.len();
16390 let mut payload_buf = [0; Self::ENCODED_LEN];
16391 let mut buf = if avail_len < Self::ENCODED_LEN {
16392 payload_buf[0..avail_len].copy_from_slice(__input);
16393 Bytes::new(&payload_buf)
16394 } else {
16395 Bytes::new(__input)
16396 };
16397 let mut __struct = Self::default();
16398 __struct.timestamp = buf.get_u64_le();
16399 __struct.last_heartbeat = buf.get_u64_le();
16400 __struct.failed_sessions = buf.get_u16_le();
16401 __struct.successful_sessions = buf.get_u16_le();
16402 __struct.signal_quality = buf.get_u8();
16403 __struct.ring_pending = buf.get_u8();
16404 __struct.tx_session_pending = buf.get_u8();
16405 __struct.rx_session_pending = buf.get_u8();
16406 Ok(__struct)
16407 }
16408 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16409 let mut __tmp = BytesMut::new(bytes);
16410 #[allow(clippy::absurd_extreme_comparisons)]
16411 #[allow(unused_comparisons)]
16412 if __tmp.remaining() < Self::ENCODED_LEN {
16413 panic!(
16414 "buffer is too small (need {} bytes, but got {})",
16415 Self::ENCODED_LEN,
16416 __tmp.remaining(),
16417 )
16418 }
16419 __tmp.put_u64_le(self.timestamp);
16420 __tmp.put_u64_le(self.last_heartbeat);
16421 __tmp.put_u16_le(self.failed_sessions);
16422 __tmp.put_u16_le(self.successful_sessions);
16423 __tmp.put_u8(self.signal_quality);
16424 __tmp.put_u8(self.ring_pending);
16425 __tmp.put_u8(self.tx_session_pending);
16426 __tmp.put_u8(self.rx_session_pending);
16427 if matches!(version, MavlinkVersion::V2) {
16428 let len = __tmp.len();
16429 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16430 } else {
16431 __tmp.len()
16432 }
16433 }
16434}
16435#[doc = "id: 149"]
16436#[doc = "The location of a landing target. See: <https://mavlink.io/en/services/landing_target.html>."]
16437#[derive(Debug, Clone, PartialEq)]
16438#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16439#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16440pub struct LANDING_TARGET_DATA {
16441 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16442 pub time_usec: u64,
16443 #[doc = "X-axis angular offset of the target from the center of the image"]
16444 pub angle_x: f32,
16445 #[doc = "Y-axis angular offset of the target from the center of the image"]
16446 pub angle_y: f32,
16447 #[doc = "Distance to the target from the vehicle"]
16448 pub distance: f32,
16449 #[doc = "Size of target along x-axis"]
16450 pub size_x: f32,
16451 #[doc = "Size of target along y-axis"]
16452 pub size_y: f32,
16453 #[doc = "The ID of the target if multiple targets are present"]
16454 pub target_num: u8,
16455 #[doc = "Coordinate frame used for following fields."]
16456 pub frame: MavFrame,
16457 #[doc = "X Position of the landing target in MAV_FRAME"]
16458 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
16459 pub x: f32,
16460 #[doc = "Y Position of the landing target in MAV_FRAME"]
16461 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
16462 pub y: f32,
16463 #[doc = "Z Position of the landing target in MAV_FRAME"]
16464 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
16465 pub z: f32,
16466 #[doc = "Quaternion of landing target orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
16467 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
16468 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
16469 pub q: [f32; 4],
16470 #[doc = "Type of landing target"]
16471 #[cfg_attr(feature = "serde", serde(default))]
16472 pub mavtype: LandingTargetType,
16473 #[doc = "Boolean indicating whether the position fields (x, y, z, q, type) contain valid target position information (valid: 1, invalid: 0). Default is 0 (invalid)."]
16474 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
16475 pub position_valid: u8,
16476}
16477impl LANDING_TARGET_DATA {
16478 pub const ENCODED_LEN: usize = 60usize;
16479 pub const DEFAULT: Self = Self {
16480 time_usec: 0_u64,
16481 angle_x: 0.0_f32,
16482 angle_y: 0.0_f32,
16483 distance: 0.0_f32,
16484 size_x: 0.0_f32,
16485 size_y: 0.0_f32,
16486 target_num: 0_u8,
16487 frame: MavFrame::DEFAULT,
16488 x: 0.0_f32,
16489 y: 0.0_f32,
16490 z: 0.0_f32,
16491 q: [0.0_f32; 4usize],
16492 mavtype: LandingTargetType::DEFAULT,
16493 position_valid: 0_u8,
16494 };
16495 #[cfg(feature = "arbitrary")]
16496 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16497 use arbitrary::{Arbitrary, Unstructured};
16498 let mut buf = [0u8; 1024];
16499 rng.fill_bytes(&mut buf);
16500 let mut unstructured = Unstructured::new(&buf);
16501 Self::arbitrary(&mut unstructured).unwrap_or_default()
16502 }
16503}
16504impl Default for LANDING_TARGET_DATA {
16505 fn default() -> Self {
16506 Self::DEFAULT.clone()
16507 }
16508}
16509impl MessageData for LANDING_TARGET_DATA {
16510 type Message = MavMessage;
16511 const ID: u32 = 149u32;
16512 const NAME: &'static str = "LANDING_TARGET";
16513 const EXTRA_CRC: u8 = 200u8;
16514 const ENCODED_LEN: usize = 60usize;
16515 fn deser(
16516 _version: MavlinkVersion,
16517 __input: &[u8],
16518 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16519 let avail_len = __input.len();
16520 let mut payload_buf = [0; Self::ENCODED_LEN];
16521 let mut buf = if avail_len < Self::ENCODED_LEN {
16522 payload_buf[0..avail_len].copy_from_slice(__input);
16523 Bytes::new(&payload_buf)
16524 } else {
16525 Bytes::new(__input)
16526 };
16527 let mut __struct = Self::default();
16528 __struct.time_usec = buf.get_u64_le();
16529 __struct.angle_x = buf.get_f32_le();
16530 __struct.angle_y = buf.get_f32_le();
16531 __struct.distance = buf.get_f32_le();
16532 __struct.size_x = buf.get_f32_le();
16533 __struct.size_y = buf.get_f32_le();
16534 __struct.target_num = buf.get_u8();
16535 let tmp = buf.get_u8();
16536 __struct.frame =
16537 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
16538 enum_type: "MavFrame",
16539 value: tmp as u32,
16540 })?;
16541 __struct.x = buf.get_f32_le();
16542 __struct.y = buf.get_f32_le();
16543 __struct.z = buf.get_f32_le();
16544 for v in &mut __struct.q {
16545 let val = buf.get_f32_le();
16546 *v = val;
16547 }
16548 let tmp = buf.get_u8();
16549 __struct.mavtype =
16550 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
16551 enum_type: "LandingTargetType",
16552 value: tmp as u32,
16553 })?;
16554 __struct.position_valid = buf.get_u8();
16555 Ok(__struct)
16556 }
16557 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16558 let mut __tmp = BytesMut::new(bytes);
16559 #[allow(clippy::absurd_extreme_comparisons)]
16560 #[allow(unused_comparisons)]
16561 if __tmp.remaining() < Self::ENCODED_LEN {
16562 panic!(
16563 "buffer is too small (need {} bytes, but got {})",
16564 Self::ENCODED_LEN,
16565 __tmp.remaining(),
16566 )
16567 }
16568 __tmp.put_u64_le(self.time_usec);
16569 __tmp.put_f32_le(self.angle_x);
16570 __tmp.put_f32_le(self.angle_y);
16571 __tmp.put_f32_le(self.distance);
16572 __tmp.put_f32_le(self.size_x);
16573 __tmp.put_f32_le(self.size_y);
16574 __tmp.put_u8(self.target_num);
16575 __tmp.put_u8(self.frame as u8);
16576 __tmp.put_f32_le(self.x);
16577 __tmp.put_f32_le(self.y);
16578 __tmp.put_f32_le(self.z);
16579 for val in &self.q {
16580 __tmp.put_f32_le(*val);
16581 }
16582 __tmp.put_u8(self.mavtype as u8);
16583 __tmp.put_u8(self.position_valid);
16584 if matches!(version, MavlinkVersion::V2) {
16585 let len = __tmp.len();
16586 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16587 } else {
16588 __tmp.len()
16589 }
16590 }
16591}
16592#[doc = "id: 8"]
16593#[doc = "Status generated in each node in the communication chain and injected into MAVLink stream."]
16594#[derive(Debug, Clone, PartialEq)]
16595#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16596#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16597pub struct LINK_NODE_STATUS_DATA {
16598 #[doc = "Timestamp (time since system boot)."]
16599 pub timestamp: u64,
16600 #[doc = "Transmit rate"]
16601 pub tx_rate: u32,
16602 #[doc = "Receive rate"]
16603 pub rx_rate: u32,
16604 #[doc = "Messages sent"]
16605 pub messages_sent: u32,
16606 #[doc = "Messages received (estimated from counting seq)"]
16607 pub messages_received: u32,
16608 #[doc = "Messages lost (estimated from counting seq)"]
16609 pub messages_lost: u32,
16610 #[doc = "Number of bytes that could not be parsed correctly."]
16611 pub rx_parse_err: u16,
16612 #[doc = "Transmit buffer overflows. This number wraps around as it reaches UINT16_MAX"]
16613 pub tx_overflows: u16,
16614 #[doc = "Receive buffer overflows. This number wraps around as it reaches UINT16_MAX"]
16615 pub rx_overflows: u16,
16616 #[doc = "Remaining free transmit buffer space"]
16617 pub tx_buf: u8,
16618 #[doc = "Remaining free receive buffer space"]
16619 pub rx_buf: u8,
16620}
16621impl LINK_NODE_STATUS_DATA {
16622 pub const ENCODED_LEN: usize = 36usize;
16623 pub const DEFAULT: Self = Self {
16624 timestamp: 0_u64,
16625 tx_rate: 0_u32,
16626 rx_rate: 0_u32,
16627 messages_sent: 0_u32,
16628 messages_received: 0_u32,
16629 messages_lost: 0_u32,
16630 rx_parse_err: 0_u16,
16631 tx_overflows: 0_u16,
16632 rx_overflows: 0_u16,
16633 tx_buf: 0_u8,
16634 rx_buf: 0_u8,
16635 };
16636 #[cfg(feature = "arbitrary")]
16637 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16638 use arbitrary::{Arbitrary, Unstructured};
16639 let mut buf = [0u8; 1024];
16640 rng.fill_bytes(&mut buf);
16641 let mut unstructured = Unstructured::new(&buf);
16642 Self::arbitrary(&mut unstructured).unwrap_or_default()
16643 }
16644}
16645impl Default for LINK_NODE_STATUS_DATA {
16646 fn default() -> Self {
16647 Self::DEFAULT.clone()
16648 }
16649}
16650impl MessageData for LINK_NODE_STATUS_DATA {
16651 type Message = MavMessage;
16652 const ID: u32 = 8u32;
16653 const NAME: &'static str = "LINK_NODE_STATUS";
16654 const EXTRA_CRC: u8 = 117u8;
16655 const ENCODED_LEN: usize = 36usize;
16656 fn deser(
16657 _version: MavlinkVersion,
16658 __input: &[u8],
16659 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16660 let avail_len = __input.len();
16661 let mut payload_buf = [0; Self::ENCODED_LEN];
16662 let mut buf = if avail_len < Self::ENCODED_LEN {
16663 payload_buf[0..avail_len].copy_from_slice(__input);
16664 Bytes::new(&payload_buf)
16665 } else {
16666 Bytes::new(__input)
16667 };
16668 let mut __struct = Self::default();
16669 __struct.timestamp = buf.get_u64_le();
16670 __struct.tx_rate = buf.get_u32_le();
16671 __struct.rx_rate = buf.get_u32_le();
16672 __struct.messages_sent = buf.get_u32_le();
16673 __struct.messages_received = buf.get_u32_le();
16674 __struct.messages_lost = buf.get_u32_le();
16675 __struct.rx_parse_err = buf.get_u16_le();
16676 __struct.tx_overflows = buf.get_u16_le();
16677 __struct.rx_overflows = buf.get_u16_le();
16678 __struct.tx_buf = buf.get_u8();
16679 __struct.rx_buf = buf.get_u8();
16680 Ok(__struct)
16681 }
16682 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16683 let mut __tmp = BytesMut::new(bytes);
16684 #[allow(clippy::absurd_extreme_comparisons)]
16685 #[allow(unused_comparisons)]
16686 if __tmp.remaining() < Self::ENCODED_LEN {
16687 panic!(
16688 "buffer is too small (need {} bytes, but got {})",
16689 Self::ENCODED_LEN,
16690 __tmp.remaining(),
16691 )
16692 }
16693 __tmp.put_u64_le(self.timestamp);
16694 __tmp.put_u32_le(self.tx_rate);
16695 __tmp.put_u32_le(self.rx_rate);
16696 __tmp.put_u32_le(self.messages_sent);
16697 __tmp.put_u32_le(self.messages_received);
16698 __tmp.put_u32_le(self.messages_lost);
16699 __tmp.put_u16_le(self.rx_parse_err);
16700 __tmp.put_u16_le(self.tx_overflows);
16701 __tmp.put_u16_le(self.rx_overflows);
16702 __tmp.put_u8(self.tx_buf);
16703 __tmp.put_u8(self.rx_buf);
16704 if matches!(version, MavlinkVersion::V2) {
16705 let len = __tmp.len();
16706 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16707 } else {
16708 __tmp.len()
16709 }
16710 }
16711}
16712#[doc = "id: 32"]
16713#[doc = "The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
16714#[derive(Debug, Clone, PartialEq)]
16715#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16716#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16717pub struct LOCAL_POSITION_NED_DATA {
16718 #[doc = "Timestamp (time since system boot)."]
16719 pub time_boot_ms: u32,
16720 #[doc = "X Position"]
16721 pub x: f32,
16722 #[doc = "Y Position"]
16723 pub y: f32,
16724 #[doc = "Z Position"]
16725 pub z: f32,
16726 #[doc = "X Speed"]
16727 pub vx: f32,
16728 #[doc = "Y Speed"]
16729 pub vy: f32,
16730 #[doc = "Z Speed"]
16731 pub vz: f32,
16732}
16733impl LOCAL_POSITION_NED_DATA {
16734 pub const ENCODED_LEN: usize = 28usize;
16735 pub const DEFAULT: Self = Self {
16736 time_boot_ms: 0_u32,
16737 x: 0.0_f32,
16738 y: 0.0_f32,
16739 z: 0.0_f32,
16740 vx: 0.0_f32,
16741 vy: 0.0_f32,
16742 vz: 0.0_f32,
16743 };
16744 #[cfg(feature = "arbitrary")]
16745 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16746 use arbitrary::{Arbitrary, Unstructured};
16747 let mut buf = [0u8; 1024];
16748 rng.fill_bytes(&mut buf);
16749 let mut unstructured = Unstructured::new(&buf);
16750 Self::arbitrary(&mut unstructured).unwrap_or_default()
16751 }
16752}
16753impl Default for LOCAL_POSITION_NED_DATA {
16754 fn default() -> Self {
16755 Self::DEFAULT.clone()
16756 }
16757}
16758impl MessageData for LOCAL_POSITION_NED_DATA {
16759 type Message = MavMessage;
16760 const ID: u32 = 32u32;
16761 const NAME: &'static str = "LOCAL_POSITION_NED";
16762 const EXTRA_CRC: u8 = 185u8;
16763 const ENCODED_LEN: usize = 28usize;
16764 fn deser(
16765 _version: MavlinkVersion,
16766 __input: &[u8],
16767 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16768 let avail_len = __input.len();
16769 let mut payload_buf = [0; Self::ENCODED_LEN];
16770 let mut buf = if avail_len < Self::ENCODED_LEN {
16771 payload_buf[0..avail_len].copy_from_slice(__input);
16772 Bytes::new(&payload_buf)
16773 } else {
16774 Bytes::new(__input)
16775 };
16776 let mut __struct = Self::default();
16777 __struct.time_boot_ms = buf.get_u32_le();
16778 __struct.x = buf.get_f32_le();
16779 __struct.y = buf.get_f32_le();
16780 __struct.z = buf.get_f32_le();
16781 __struct.vx = buf.get_f32_le();
16782 __struct.vy = buf.get_f32_le();
16783 __struct.vz = buf.get_f32_le();
16784 Ok(__struct)
16785 }
16786 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16787 let mut __tmp = BytesMut::new(bytes);
16788 #[allow(clippy::absurd_extreme_comparisons)]
16789 #[allow(unused_comparisons)]
16790 if __tmp.remaining() < Self::ENCODED_LEN {
16791 panic!(
16792 "buffer is too small (need {} bytes, but got {})",
16793 Self::ENCODED_LEN,
16794 __tmp.remaining(),
16795 )
16796 }
16797 __tmp.put_u32_le(self.time_boot_ms);
16798 __tmp.put_f32_le(self.x);
16799 __tmp.put_f32_le(self.y);
16800 __tmp.put_f32_le(self.z);
16801 __tmp.put_f32_le(self.vx);
16802 __tmp.put_f32_le(self.vy);
16803 __tmp.put_f32_le(self.vz);
16804 if matches!(version, MavlinkVersion::V2) {
16805 let len = __tmp.len();
16806 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16807 } else {
16808 __tmp.len()
16809 }
16810 }
16811}
16812#[doc = "id: 64"]
16813#[doc = "The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
16814#[derive(Debug, Clone, PartialEq)]
16815#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16816#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16817pub struct LOCAL_POSITION_NED_COV_DATA {
16818 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16819 pub time_usec: u64,
16820 #[doc = "X Position"]
16821 pub x: f32,
16822 #[doc = "Y Position"]
16823 pub y: f32,
16824 #[doc = "Z Position"]
16825 pub z: f32,
16826 #[doc = "X Speed"]
16827 pub vx: f32,
16828 #[doc = "Y Speed"]
16829 pub vy: f32,
16830 #[doc = "Z Speed"]
16831 pub vz: f32,
16832 #[doc = "X Acceleration"]
16833 pub ax: f32,
16834 #[doc = "Y Acceleration"]
16835 pub ay: f32,
16836 #[doc = "Z Acceleration"]
16837 pub az: f32,
16838 #[doc = "Row-major representation of position, velocity and acceleration 9x9 cross-covariance matrix upper right triangle (states: x, y, z, vx, vy, vz, ax, ay, az; first nine entries are the first ROW, next eight entries are the second row, etc.). If unknown, assign NaN value to first element in the array."]
16839 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
16840 pub covariance: [f32; 45],
16841 #[doc = "Class id of the estimator this estimate originated from."]
16842 pub estimator_type: MavEstimatorType,
16843}
16844impl LOCAL_POSITION_NED_COV_DATA {
16845 pub const ENCODED_LEN: usize = 225usize;
16846 pub const DEFAULT: Self = Self {
16847 time_usec: 0_u64,
16848 x: 0.0_f32,
16849 y: 0.0_f32,
16850 z: 0.0_f32,
16851 vx: 0.0_f32,
16852 vy: 0.0_f32,
16853 vz: 0.0_f32,
16854 ax: 0.0_f32,
16855 ay: 0.0_f32,
16856 az: 0.0_f32,
16857 covariance: [0.0_f32; 45usize],
16858 estimator_type: MavEstimatorType::DEFAULT,
16859 };
16860 #[cfg(feature = "arbitrary")]
16861 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16862 use arbitrary::{Arbitrary, Unstructured};
16863 let mut buf = [0u8; 1024];
16864 rng.fill_bytes(&mut buf);
16865 let mut unstructured = Unstructured::new(&buf);
16866 Self::arbitrary(&mut unstructured).unwrap_or_default()
16867 }
16868}
16869impl Default for LOCAL_POSITION_NED_COV_DATA {
16870 fn default() -> Self {
16871 Self::DEFAULT.clone()
16872 }
16873}
16874impl MessageData for LOCAL_POSITION_NED_COV_DATA {
16875 type Message = MavMessage;
16876 const ID: u32 = 64u32;
16877 const NAME: &'static str = "LOCAL_POSITION_NED_COV";
16878 const EXTRA_CRC: u8 = 191u8;
16879 const ENCODED_LEN: usize = 225usize;
16880 fn deser(
16881 _version: MavlinkVersion,
16882 __input: &[u8],
16883 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16884 let avail_len = __input.len();
16885 let mut payload_buf = [0; Self::ENCODED_LEN];
16886 let mut buf = if avail_len < Self::ENCODED_LEN {
16887 payload_buf[0..avail_len].copy_from_slice(__input);
16888 Bytes::new(&payload_buf)
16889 } else {
16890 Bytes::new(__input)
16891 };
16892 let mut __struct = Self::default();
16893 __struct.time_usec = buf.get_u64_le();
16894 __struct.x = buf.get_f32_le();
16895 __struct.y = buf.get_f32_le();
16896 __struct.z = buf.get_f32_le();
16897 __struct.vx = buf.get_f32_le();
16898 __struct.vy = buf.get_f32_le();
16899 __struct.vz = buf.get_f32_le();
16900 __struct.ax = buf.get_f32_le();
16901 __struct.ay = buf.get_f32_le();
16902 __struct.az = buf.get_f32_le();
16903 for v in &mut __struct.covariance {
16904 let val = buf.get_f32_le();
16905 *v = val;
16906 }
16907 let tmp = buf.get_u8();
16908 __struct.estimator_type =
16909 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
16910 enum_type: "MavEstimatorType",
16911 value: tmp as u32,
16912 })?;
16913 Ok(__struct)
16914 }
16915 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16916 let mut __tmp = BytesMut::new(bytes);
16917 #[allow(clippy::absurd_extreme_comparisons)]
16918 #[allow(unused_comparisons)]
16919 if __tmp.remaining() < Self::ENCODED_LEN {
16920 panic!(
16921 "buffer is too small (need {} bytes, but got {})",
16922 Self::ENCODED_LEN,
16923 __tmp.remaining(),
16924 )
16925 }
16926 __tmp.put_u64_le(self.time_usec);
16927 __tmp.put_f32_le(self.x);
16928 __tmp.put_f32_le(self.y);
16929 __tmp.put_f32_le(self.z);
16930 __tmp.put_f32_le(self.vx);
16931 __tmp.put_f32_le(self.vy);
16932 __tmp.put_f32_le(self.vz);
16933 __tmp.put_f32_le(self.ax);
16934 __tmp.put_f32_le(self.ay);
16935 __tmp.put_f32_le(self.az);
16936 for val in &self.covariance {
16937 __tmp.put_f32_le(*val);
16938 }
16939 __tmp.put_u8(self.estimator_type as u8);
16940 if matches!(version, MavlinkVersion::V2) {
16941 let len = __tmp.len();
16942 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16943 } else {
16944 __tmp.len()
16945 }
16946 }
16947}
16948#[doc = "id: 89"]
16949#[doc = "The offset in X, Y, Z and yaw between the LOCAL_POSITION_NED messages of MAV X and the global coordinate frame in NED coordinates. Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
16950#[derive(Debug, Clone, PartialEq)]
16951#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16952#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16953pub struct LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
16954 #[doc = "Timestamp (time since system boot)."]
16955 pub time_boot_ms: u32,
16956 #[doc = "X Position"]
16957 pub x: f32,
16958 #[doc = "Y Position"]
16959 pub y: f32,
16960 #[doc = "Z Position"]
16961 pub z: f32,
16962 #[doc = "Roll"]
16963 pub roll: f32,
16964 #[doc = "Pitch"]
16965 pub pitch: f32,
16966 #[doc = "Yaw"]
16967 pub yaw: f32,
16968}
16969impl LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
16970 pub const ENCODED_LEN: usize = 28usize;
16971 pub const DEFAULT: Self = Self {
16972 time_boot_ms: 0_u32,
16973 x: 0.0_f32,
16974 y: 0.0_f32,
16975 z: 0.0_f32,
16976 roll: 0.0_f32,
16977 pitch: 0.0_f32,
16978 yaw: 0.0_f32,
16979 };
16980 #[cfg(feature = "arbitrary")]
16981 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16982 use arbitrary::{Arbitrary, Unstructured};
16983 let mut buf = [0u8; 1024];
16984 rng.fill_bytes(&mut buf);
16985 let mut unstructured = Unstructured::new(&buf);
16986 Self::arbitrary(&mut unstructured).unwrap_or_default()
16987 }
16988}
16989impl Default for LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
16990 fn default() -> Self {
16991 Self::DEFAULT.clone()
16992 }
16993}
16994impl MessageData for LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
16995 type Message = MavMessage;
16996 const ID: u32 = 89u32;
16997 const NAME: &'static str = "LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET";
16998 const EXTRA_CRC: u8 = 231u8;
16999 const ENCODED_LEN: usize = 28usize;
17000 fn deser(
17001 _version: MavlinkVersion,
17002 __input: &[u8],
17003 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17004 let avail_len = __input.len();
17005 let mut payload_buf = [0; Self::ENCODED_LEN];
17006 let mut buf = if avail_len < Self::ENCODED_LEN {
17007 payload_buf[0..avail_len].copy_from_slice(__input);
17008 Bytes::new(&payload_buf)
17009 } else {
17010 Bytes::new(__input)
17011 };
17012 let mut __struct = Self::default();
17013 __struct.time_boot_ms = buf.get_u32_le();
17014 __struct.x = buf.get_f32_le();
17015 __struct.y = buf.get_f32_le();
17016 __struct.z = buf.get_f32_le();
17017 __struct.roll = buf.get_f32_le();
17018 __struct.pitch = buf.get_f32_le();
17019 __struct.yaw = buf.get_f32_le();
17020 Ok(__struct)
17021 }
17022 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17023 let mut __tmp = BytesMut::new(bytes);
17024 #[allow(clippy::absurd_extreme_comparisons)]
17025 #[allow(unused_comparisons)]
17026 if __tmp.remaining() < Self::ENCODED_LEN {
17027 panic!(
17028 "buffer is too small (need {} bytes, but got {})",
17029 Self::ENCODED_LEN,
17030 __tmp.remaining(),
17031 )
17032 }
17033 __tmp.put_u32_le(self.time_boot_ms);
17034 __tmp.put_f32_le(self.x);
17035 __tmp.put_f32_le(self.y);
17036 __tmp.put_f32_le(self.z);
17037 __tmp.put_f32_le(self.roll);
17038 __tmp.put_f32_le(self.pitch);
17039 __tmp.put_f32_le(self.yaw);
17040 if matches!(version, MavlinkVersion::V2) {
17041 let len = __tmp.len();
17042 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17043 } else {
17044 __tmp.len()
17045 }
17046 }
17047}
17048#[doc = "id: 268"]
17049#[doc = "An ack for a LOGGING_DATA_ACKED message."]
17050#[derive(Debug, Clone, PartialEq)]
17051#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17052#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17053pub struct LOGGING_ACK_DATA {
17054 #[doc = "sequence number (must match the one in LOGGING_DATA_ACKED)"]
17055 pub sequence: u16,
17056 #[doc = "system ID of the target"]
17057 pub target_system: u8,
17058 #[doc = "component ID of the target"]
17059 pub target_component: u8,
17060}
17061impl LOGGING_ACK_DATA {
17062 pub const ENCODED_LEN: usize = 4usize;
17063 pub const DEFAULT: Self = Self {
17064 sequence: 0_u16,
17065 target_system: 0_u8,
17066 target_component: 0_u8,
17067 };
17068 #[cfg(feature = "arbitrary")]
17069 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17070 use arbitrary::{Arbitrary, Unstructured};
17071 let mut buf = [0u8; 1024];
17072 rng.fill_bytes(&mut buf);
17073 let mut unstructured = Unstructured::new(&buf);
17074 Self::arbitrary(&mut unstructured).unwrap_or_default()
17075 }
17076}
17077impl Default for LOGGING_ACK_DATA {
17078 fn default() -> Self {
17079 Self::DEFAULT.clone()
17080 }
17081}
17082impl MessageData for LOGGING_ACK_DATA {
17083 type Message = MavMessage;
17084 const ID: u32 = 268u32;
17085 const NAME: &'static str = "LOGGING_ACK";
17086 const EXTRA_CRC: u8 = 14u8;
17087 const ENCODED_LEN: usize = 4usize;
17088 fn deser(
17089 _version: MavlinkVersion,
17090 __input: &[u8],
17091 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17092 let avail_len = __input.len();
17093 let mut payload_buf = [0; Self::ENCODED_LEN];
17094 let mut buf = if avail_len < Self::ENCODED_LEN {
17095 payload_buf[0..avail_len].copy_from_slice(__input);
17096 Bytes::new(&payload_buf)
17097 } else {
17098 Bytes::new(__input)
17099 };
17100 let mut __struct = Self::default();
17101 __struct.sequence = buf.get_u16_le();
17102 __struct.target_system = buf.get_u8();
17103 __struct.target_component = buf.get_u8();
17104 Ok(__struct)
17105 }
17106 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17107 let mut __tmp = BytesMut::new(bytes);
17108 #[allow(clippy::absurd_extreme_comparisons)]
17109 #[allow(unused_comparisons)]
17110 if __tmp.remaining() < Self::ENCODED_LEN {
17111 panic!(
17112 "buffer is too small (need {} bytes, but got {})",
17113 Self::ENCODED_LEN,
17114 __tmp.remaining(),
17115 )
17116 }
17117 __tmp.put_u16_le(self.sequence);
17118 __tmp.put_u8(self.target_system);
17119 __tmp.put_u8(self.target_component);
17120 if matches!(version, MavlinkVersion::V2) {
17121 let len = __tmp.len();
17122 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17123 } else {
17124 __tmp.len()
17125 }
17126 }
17127}
17128#[doc = "id: 266"]
17129#[doc = "A message containing logged data (see also MAV_CMD_LOGGING_START)."]
17130#[derive(Debug, Clone, PartialEq)]
17131#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17132#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17133pub struct LOGGING_DATA_DATA {
17134 #[doc = "sequence number (can wrap)"]
17135 pub sequence: u16,
17136 #[doc = "system ID of the target"]
17137 pub target_system: u8,
17138 #[doc = "component ID of the target"]
17139 pub target_component: u8,
17140 #[doc = "data length"]
17141 pub length: u8,
17142 #[doc = "offset into data where first message starts. This can be used for recovery, when a previous message got lost (set to UINT8_MAX if no start exists)."]
17143 pub first_message_offset: u8,
17144 #[doc = "logged data"]
17145 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
17146 pub data: [u8; 249],
17147}
17148impl LOGGING_DATA_DATA {
17149 pub const ENCODED_LEN: usize = 255usize;
17150 pub const DEFAULT: Self = Self {
17151 sequence: 0_u16,
17152 target_system: 0_u8,
17153 target_component: 0_u8,
17154 length: 0_u8,
17155 first_message_offset: 0_u8,
17156 data: [0_u8; 249usize],
17157 };
17158 #[cfg(feature = "arbitrary")]
17159 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17160 use arbitrary::{Arbitrary, Unstructured};
17161 let mut buf = [0u8; 1024];
17162 rng.fill_bytes(&mut buf);
17163 let mut unstructured = Unstructured::new(&buf);
17164 Self::arbitrary(&mut unstructured).unwrap_or_default()
17165 }
17166}
17167impl Default for LOGGING_DATA_DATA {
17168 fn default() -> Self {
17169 Self::DEFAULT.clone()
17170 }
17171}
17172impl MessageData for LOGGING_DATA_DATA {
17173 type Message = MavMessage;
17174 const ID: u32 = 266u32;
17175 const NAME: &'static str = "LOGGING_DATA";
17176 const EXTRA_CRC: u8 = 193u8;
17177 const ENCODED_LEN: usize = 255usize;
17178 fn deser(
17179 _version: MavlinkVersion,
17180 __input: &[u8],
17181 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17182 let avail_len = __input.len();
17183 let mut payload_buf = [0; Self::ENCODED_LEN];
17184 let mut buf = if avail_len < Self::ENCODED_LEN {
17185 payload_buf[0..avail_len].copy_from_slice(__input);
17186 Bytes::new(&payload_buf)
17187 } else {
17188 Bytes::new(__input)
17189 };
17190 let mut __struct = Self::default();
17191 __struct.sequence = buf.get_u16_le();
17192 __struct.target_system = buf.get_u8();
17193 __struct.target_component = buf.get_u8();
17194 __struct.length = buf.get_u8();
17195 __struct.first_message_offset = buf.get_u8();
17196 for v in &mut __struct.data {
17197 let val = buf.get_u8();
17198 *v = val;
17199 }
17200 Ok(__struct)
17201 }
17202 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17203 let mut __tmp = BytesMut::new(bytes);
17204 #[allow(clippy::absurd_extreme_comparisons)]
17205 #[allow(unused_comparisons)]
17206 if __tmp.remaining() < Self::ENCODED_LEN {
17207 panic!(
17208 "buffer is too small (need {} bytes, but got {})",
17209 Self::ENCODED_LEN,
17210 __tmp.remaining(),
17211 )
17212 }
17213 __tmp.put_u16_le(self.sequence);
17214 __tmp.put_u8(self.target_system);
17215 __tmp.put_u8(self.target_component);
17216 __tmp.put_u8(self.length);
17217 __tmp.put_u8(self.first_message_offset);
17218 for val in &self.data {
17219 __tmp.put_u8(*val);
17220 }
17221 if matches!(version, MavlinkVersion::V2) {
17222 let len = __tmp.len();
17223 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17224 } else {
17225 __tmp.len()
17226 }
17227 }
17228}
17229#[doc = "id: 267"]
17230#[doc = "A message containing logged data which requires a LOGGING_ACK to be sent back."]
17231#[derive(Debug, Clone, PartialEq)]
17232#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17233#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17234pub struct LOGGING_DATA_ACKED_DATA {
17235 #[doc = "sequence number (can wrap)"]
17236 pub sequence: u16,
17237 #[doc = "system ID of the target"]
17238 pub target_system: u8,
17239 #[doc = "component ID of the target"]
17240 pub target_component: u8,
17241 #[doc = "data length"]
17242 pub length: u8,
17243 #[doc = "offset into data where first message starts. This can be used for recovery, when a previous message got lost (set to UINT8_MAX if no start exists)."]
17244 pub first_message_offset: u8,
17245 #[doc = "logged data"]
17246 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
17247 pub data: [u8; 249],
17248}
17249impl LOGGING_DATA_ACKED_DATA {
17250 pub const ENCODED_LEN: usize = 255usize;
17251 pub const DEFAULT: Self = Self {
17252 sequence: 0_u16,
17253 target_system: 0_u8,
17254 target_component: 0_u8,
17255 length: 0_u8,
17256 first_message_offset: 0_u8,
17257 data: [0_u8; 249usize],
17258 };
17259 #[cfg(feature = "arbitrary")]
17260 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17261 use arbitrary::{Arbitrary, Unstructured};
17262 let mut buf = [0u8; 1024];
17263 rng.fill_bytes(&mut buf);
17264 let mut unstructured = Unstructured::new(&buf);
17265 Self::arbitrary(&mut unstructured).unwrap_or_default()
17266 }
17267}
17268impl Default for LOGGING_DATA_ACKED_DATA {
17269 fn default() -> Self {
17270 Self::DEFAULT.clone()
17271 }
17272}
17273impl MessageData for LOGGING_DATA_ACKED_DATA {
17274 type Message = MavMessage;
17275 const ID: u32 = 267u32;
17276 const NAME: &'static str = "LOGGING_DATA_ACKED";
17277 const EXTRA_CRC: u8 = 35u8;
17278 const ENCODED_LEN: usize = 255usize;
17279 fn deser(
17280 _version: MavlinkVersion,
17281 __input: &[u8],
17282 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17283 let avail_len = __input.len();
17284 let mut payload_buf = [0; Self::ENCODED_LEN];
17285 let mut buf = if avail_len < Self::ENCODED_LEN {
17286 payload_buf[0..avail_len].copy_from_slice(__input);
17287 Bytes::new(&payload_buf)
17288 } else {
17289 Bytes::new(__input)
17290 };
17291 let mut __struct = Self::default();
17292 __struct.sequence = buf.get_u16_le();
17293 __struct.target_system = buf.get_u8();
17294 __struct.target_component = buf.get_u8();
17295 __struct.length = buf.get_u8();
17296 __struct.first_message_offset = buf.get_u8();
17297 for v in &mut __struct.data {
17298 let val = buf.get_u8();
17299 *v = val;
17300 }
17301 Ok(__struct)
17302 }
17303 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17304 let mut __tmp = BytesMut::new(bytes);
17305 #[allow(clippy::absurd_extreme_comparisons)]
17306 #[allow(unused_comparisons)]
17307 if __tmp.remaining() < Self::ENCODED_LEN {
17308 panic!(
17309 "buffer is too small (need {} bytes, but got {})",
17310 Self::ENCODED_LEN,
17311 __tmp.remaining(),
17312 )
17313 }
17314 __tmp.put_u16_le(self.sequence);
17315 __tmp.put_u8(self.target_system);
17316 __tmp.put_u8(self.target_component);
17317 __tmp.put_u8(self.length);
17318 __tmp.put_u8(self.first_message_offset);
17319 for val in &self.data {
17320 __tmp.put_u8(*val);
17321 }
17322 if matches!(version, MavlinkVersion::V2) {
17323 let len = __tmp.len();
17324 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17325 } else {
17326 __tmp.len()
17327 }
17328 }
17329}
17330#[doc = "id: 120"]
17331#[doc = "Reply to LOG_REQUEST_DATA."]
17332#[derive(Debug, Clone, PartialEq)]
17333#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17334#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17335pub struct LOG_DATA_DATA {
17336 #[doc = "Offset into the log"]
17337 pub ofs: u32,
17338 #[doc = "Log id (from LOG_ENTRY reply)"]
17339 pub id: u16,
17340 #[doc = "Number of bytes (zero for end of log)"]
17341 pub count: u8,
17342 #[doc = "log data"]
17343 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
17344 pub data: [u8; 90],
17345}
17346impl LOG_DATA_DATA {
17347 pub const ENCODED_LEN: usize = 97usize;
17348 pub const DEFAULT: Self = Self {
17349 ofs: 0_u32,
17350 id: 0_u16,
17351 count: 0_u8,
17352 data: [0_u8; 90usize],
17353 };
17354 #[cfg(feature = "arbitrary")]
17355 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17356 use arbitrary::{Arbitrary, Unstructured};
17357 let mut buf = [0u8; 1024];
17358 rng.fill_bytes(&mut buf);
17359 let mut unstructured = Unstructured::new(&buf);
17360 Self::arbitrary(&mut unstructured).unwrap_or_default()
17361 }
17362}
17363impl Default for LOG_DATA_DATA {
17364 fn default() -> Self {
17365 Self::DEFAULT.clone()
17366 }
17367}
17368impl MessageData for LOG_DATA_DATA {
17369 type Message = MavMessage;
17370 const ID: u32 = 120u32;
17371 const NAME: &'static str = "LOG_DATA";
17372 const EXTRA_CRC: u8 = 134u8;
17373 const ENCODED_LEN: usize = 97usize;
17374 fn deser(
17375 _version: MavlinkVersion,
17376 __input: &[u8],
17377 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17378 let avail_len = __input.len();
17379 let mut payload_buf = [0; Self::ENCODED_LEN];
17380 let mut buf = if avail_len < Self::ENCODED_LEN {
17381 payload_buf[0..avail_len].copy_from_slice(__input);
17382 Bytes::new(&payload_buf)
17383 } else {
17384 Bytes::new(__input)
17385 };
17386 let mut __struct = Self::default();
17387 __struct.ofs = buf.get_u32_le();
17388 __struct.id = buf.get_u16_le();
17389 __struct.count = buf.get_u8();
17390 for v in &mut __struct.data {
17391 let val = buf.get_u8();
17392 *v = val;
17393 }
17394 Ok(__struct)
17395 }
17396 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17397 let mut __tmp = BytesMut::new(bytes);
17398 #[allow(clippy::absurd_extreme_comparisons)]
17399 #[allow(unused_comparisons)]
17400 if __tmp.remaining() < Self::ENCODED_LEN {
17401 panic!(
17402 "buffer is too small (need {} bytes, but got {})",
17403 Self::ENCODED_LEN,
17404 __tmp.remaining(),
17405 )
17406 }
17407 __tmp.put_u32_le(self.ofs);
17408 __tmp.put_u16_le(self.id);
17409 __tmp.put_u8(self.count);
17410 for val in &self.data {
17411 __tmp.put_u8(*val);
17412 }
17413 if matches!(version, MavlinkVersion::V2) {
17414 let len = __tmp.len();
17415 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17416 } else {
17417 __tmp.len()
17418 }
17419 }
17420}
17421#[doc = "id: 118"]
17422#[doc = "Reply to LOG_REQUEST_LIST."]
17423#[derive(Debug, Clone, PartialEq)]
17424#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17425#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17426pub struct LOG_ENTRY_DATA {
17427 #[doc = "UTC timestamp of log since 1970, or 0 if not available"]
17428 pub time_utc: u32,
17429 #[doc = "Size of the log (may be approximate)"]
17430 pub size: u32,
17431 #[doc = "Log id"]
17432 pub id: u16,
17433 #[doc = "Total number of logs"]
17434 pub num_logs: u16,
17435 #[doc = "High log number"]
17436 pub last_log_num: u16,
17437}
17438impl LOG_ENTRY_DATA {
17439 pub const ENCODED_LEN: usize = 14usize;
17440 pub const DEFAULT: Self = Self {
17441 time_utc: 0_u32,
17442 size: 0_u32,
17443 id: 0_u16,
17444 num_logs: 0_u16,
17445 last_log_num: 0_u16,
17446 };
17447 #[cfg(feature = "arbitrary")]
17448 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17449 use arbitrary::{Arbitrary, Unstructured};
17450 let mut buf = [0u8; 1024];
17451 rng.fill_bytes(&mut buf);
17452 let mut unstructured = Unstructured::new(&buf);
17453 Self::arbitrary(&mut unstructured).unwrap_or_default()
17454 }
17455}
17456impl Default for LOG_ENTRY_DATA {
17457 fn default() -> Self {
17458 Self::DEFAULT.clone()
17459 }
17460}
17461impl MessageData for LOG_ENTRY_DATA {
17462 type Message = MavMessage;
17463 const ID: u32 = 118u32;
17464 const NAME: &'static str = "LOG_ENTRY";
17465 const EXTRA_CRC: u8 = 56u8;
17466 const ENCODED_LEN: usize = 14usize;
17467 fn deser(
17468 _version: MavlinkVersion,
17469 __input: &[u8],
17470 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17471 let avail_len = __input.len();
17472 let mut payload_buf = [0; Self::ENCODED_LEN];
17473 let mut buf = if avail_len < Self::ENCODED_LEN {
17474 payload_buf[0..avail_len].copy_from_slice(__input);
17475 Bytes::new(&payload_buf)
17476 } else {
17477 Bytes::new(__input)
17478 };
17479 let mut __struct = Self::default();
17480 __struct.time_utc = buf.get_u32_le();
17481 __struct.size = buf.get_u32_le();
17482 __struct.id = buf.get_u16_le();
17483 __struct.num_logs = buf.get_u16_le();
17484 __struct.last_log_num = buf.get_u16_le();
17485 Ok(__struct)
17486 }
17487 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17488 let mut __tmp = BytesMut::new(bytes);
17489 #[allow(clippy::absurd_extreme_comparisons)]
17490 #[allow(unused_comparisons)]
17491 if __tmp.remaining() < Self::ENCODED_LEN {
17492 panic!(
17493 "buffer is too small (need {} bytes, but got {})",
17494 Self::ENCODED_LEN,
17495 __tmp.remaining(),
17496 )
17497 }
17498 __tmp.put_u32_le(self.time_utc);
17499 __tmp.put_u32_le(self.size);
17500 __tmp.put_u16_le(self.id);
17501 __tmp.put_u16_le(self.num_logs);
17502 __tmp.put_u16_le(self.last_log_num);
17503 if matches!(version, MavlinkVersion::V2) {
17504 let len = __tmp.len();
17505 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17506 } else {
17507 __tmp.len()
17508 }
17509 }
17510}
17511#[doc = "id: 121"]
17512#[doc = "Erase all logs."]
17513#[derive(Debug, Clone, PartialEq)]
17514#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17515#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17516pub struct LOG_ERASE_DATA {
17517 #[doc = "System ID"]
17518 pub target_system: u8,
17519 #[doc = "Component ID"]
17520 pub target_component: u8,
17521}
17522impl LOG_ERASE_DATA {
17523 pub const ENCODED_LEN: usize = 2usize;
17524 pub const DEFAULT: Self = Self {
17525 target_system: 0_u8,
17526 target_component: 0_u8,
17527 };
17528 #[cfg(feature = "arbitrary")]
17529 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17530 use arbitrary::{Arbitrary, Unstructured};
17531 let mut buf = [0u8; 1024];
17532 rng.fill_bytes(&mut buf);
17533 let mut unstructured = Unstructured::new(&buf);
17534 Self::arbitrary(&mut unstructured).unwrap_or_default()
17535 }
17536}
17537impl Default for LOG_ERASE_DATA {
17538 fn default() -> Self {
17539 Self::DEFAULT.clone()
17540 }
17541}
17542impl MessageData for LOG_ERASE_DATA {
17543 type Message = MavMessage;
17544 const ID: u32 = 121u32;
17545 const NAME: &'static str = "LOG_ERASE";
17546 const EXTRA_CRC: u8 = 237u8;
17547 const ENCODED_LEN: usize = 2usize;
17548 fn deser(
17549 _version: MavlinkVersion,
17550 __input: &[u8],
17551 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17552 let avail_len = __input.len();
17553 let mut payload_buf = [0; Self::ENCODED_LEN];
17554 let mut buf = if avail_len < Self::ENCODED_LEN {
17555 payload_buf[0..avail_len].copy_from_slice(__input);
17556 Bytes::new(&payload_buf)
17557 } else {
17558 Bytes::new(__input)
17559 };
17560 let mut __struct = Self::default();
17561 __struct.target_system = buf.get_u8();
17562 __struct.target_component = buf.get_u8();
17563 Ok(__struct)
17564 }
17565 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17566 let mut __tmp = BytesMut::new(bytes);
17567 #[allow(clippy::absurd_extreme_comparisons)]
17568 #[allow(unused_comparisons)]
17569 if __tmp.remaining() < Self::ENCODED_LEN {
17570 panic!(
17571 "buffer is too small (need {} bytes, but got {})",
17572 Self::ENCODED_LEN,
17573 __tmp.remaining(),
17574 )
17575 }
17576 __tmp.put_u8(self.target_system);
17577 __tmp.put_u8(self.target_component);
17578 if matches!(version, MavlinkVersion::V2) {
17579 let len = __tmp.len();
17580 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17581 } else {
17582 __tmp.len()
17583 }
17584 }
17585}
17586#[doc = "id: 119"]
17587#[doc = "Request a chunk of a log."]
17588#[derive(Debug, Clone, PartialEq)]
17589#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17590#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17591pub struct LOG_REQUEST_DATA_DATA {
17592 #[doc = "Offset into the log"]
17593 pub ofs: u32,
17594 #[doc = "Number of bytes"]
17595 pub count: u32,
17596 #[doc = "Log id (from LOG_ENTRY reply)"]
17597 pub id: u16,
17598 #[doc = "System ID"]
17599 pub target_system: u8,
17600 #[doc = "Component ID"]
17601 pub target_component: u8,
17602}
17603impl LOG_REQUEST_DATA_DATA {
17604 pub const ENCODED_LEN: usize = 12usize;
17605 pub const DEFAULT: Self = Self {
17606 ofs: 0_u32,
17607 count: 0_u32,
17608 id: 0_u16,
17609 target_system: 0_u8,
17610 target_component: 0_u8,
17611 };
17612 #[cfg(feature = "arbitrary")]
17613 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17614 use arbitrary::{Arbitrary, Unstructured};
17615 let mut buf = [0u8; 1024];
17616 rng.fill_bytes(&mut buf);
17617 let mut unstructured = Unstructured::new(&buf);
17618 Self::arbitrary(&mut unstructured).unwrap_or_default()
17619 }
17620}
17621impl Default for LOG_REQUEST_DATA_DATA {
17622 fn default() -> Self {
17623 Self::DEFAULT.clone()
17624 }
17625}
17626impl MessageData for LOG_REQUEST_DATA_DATA {
17627 type Message = MavMessage;
17628 const ID: u32 = 119u32;
17629 const NAME: &'static str = "LOG_REQUEST_DATA";
17630 const EXTRA_CRC: u8 = 116u8;
17631 const ENCODED_LEN: usize = 12usize;
17632 fn deser(
17633 _version: MavlinkVersion,
17634 __input: &[u8],
17635 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17636 let avail_len = __input.len();
17637 let mut payload_buf = [0; Self::ENCODED_LEN];
17638 let mut buf = if avail_len < Self::ENCODED_LEN {
17639 payload_buf[0..avail_len].copy_from_slice(__input);
17640 Bytes::new(&payload_buf)
17641 } else {
17642 Bytes::new(__input)
17643 };
17644 let mut __struct = Self::default();
17645 __struct.ofs = buf.get_u32_le();
17646 __struct.count = buf.get_u32_le();
17647 __struct.id = buf.get_u16_le();
17648 __struct.target_system = buf.get_u8();
17649 __struct.target_component = buf.get_u8();
17650 Ok(__struct)
17651 }
17652 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17653 let mut __tmp = BytesMut::new(bytes);
17654 #[allow(clippy::absurd_extreme_comparisons)]
17655 #[allow(unused_comparisons)]
17656 if __tmp.remaining() < Self::ENCODED_LEN {
17657 panic!(
17658 "buffer is too small (need {} bytes, but got {})",
17659 Self::ENCODED_LEN,
17660 __tmp.remaining(),
17661 )
17662 }
17663 __tmp.put_u32_le(self.ofs);
17664 __tmp.put_u32_le(self.count);
17665 __tmp.put_u16_le(self.id);
17666 __tmp.put_u8(self.target_system);
17667 __tmp.put_u8(self.target_component);
17668 if matches!(version, MavlinkVersion::V2) {
17669 let len = __tmp.len();
17670 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17671 } else {
17672 __tmp.len()
17673 }
17674 }
17675}
17676#[doc = "id: 122"]
17677#[doc = "Stop log transfer and resume normal logging."]
17678#[derive(Debug, Clone, PartialEq)]
17679#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17680#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17681pub struct LOG_REQUEST_END_DATA {
17682 #[doc = "System ID"]
17683 pub target_system: u8,
17684 #[doc = "Component ID"]
17685 pub target_component: u8,
17686}
17687impl LOG_REQUEST_END_DATA {
17688 pub const ENCODED_LEN: usize = 2usize;
17689 pub const DEFAULT: Self = Self {
17690 target_system: 0_u8,
17691 target_component: 0_u8,
17692 };
17693 #[cfg(feature = "arbitrary")]
17694 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17695 use arbitrary::{Arbitrary, Unstructured};
17696 let mut buf = [0u8; 1024];
17697 rng.fill_bytes(&mut buf);
17698 let mut unstructured = Unstructured::new(&buf);
17699 Self::arbitrary(&mut unstructured).unwrap_or_default()
17700 }
17701}
17702impl Default for LOG_REQUEST_END_DATA {
17703 fn default() -> Self {
17704 Self::DEFAULT.clone()
17705 }
17706}
17707impl MessageData for LOG_REQUEST_END_DATA {
17708 type Message = MavMessage;
17709 const ID: u32 = 122u32;
17710 const NAME: &'static str = "LOG_REQUEST_END";
17711 const EXTRA_CRC: u8 = 203u8;
17712 const ENCODED_LEN: usize = 2usize;
17713 fn deser(
17714 _version: MavlinkVersion,
17715 __input: &[u8],
17716 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17717 let avail_len = __input.len();
17718 let mut payload_buf = [0; Self::ENCODED_LEN];
17719 let mut buf = if avail_len < Self::ENCODED_LEN {
17720 payload_buf[0..avail_len].copy_from_slice(__input);
17721 Bytes::new(&payload_buf)
17722 } else {
17723 Bytes::new(__input)
17724 };
17725 let mut __struct = Self::default();
17726 __struct.target_system = buf.get_u8();
17727 __struct.target_component = buf.get_u8();
17728 Ok(__struct)
17729 }
17730 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17731 let mut __tmp = BytesMut::new(bytes);
17732 #[allow(clippy::absurd_extreme_comparisons)]
17733 #[allow(unused_comparisons)]
17734 if __tmp.remaining() < Self::ENCODED_LEN {
17735 panic!(
17736 "buffer is too small (need {} bytes, but got {})",
17737 Self::ENCODED_LEN,
17738 __tmp.remaining(),
17739 )
17740 }
17741 __tmp.put_u8(self.target_system);
17742 __tmp.put_u8(self.target_component);
17743 if matches!(version, MavlinkVersion::V2) {
17744 let len = __tmp.len();
17745 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17746 } else {
17747 __tmp.len()
17748 }
17749 }
17750}
17751#[doc = "id: 117"]
17752#[doc = "Request a list of available logs. On some systems calling this may stop on-board logging until LOG_REQUEST_END is called. If there are no log files available this request shall be answered with one LOG_ENTRY message with id = 0 and num_logs = 0."]
17753#[derive(Debug, Clone, PartialEq)]
17754#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17755#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17756pub struct LOG_REQUEST_LIST_DATA {
17757 #[doc = "First log id (0 for first available)"]
17758 pub start: u16,
17759 #[doc = "Last log id (0xffff for last available)"]
17760 pub end: u16,
17761 #[doc = "System ID"]
17762 pub target_system: u8,
17763 #[doc = "Component ID"]
17764 pub target_component: u8,
17765}
17766impl LOG_REQUEST_LIST_DATA {
17767 pub const ENCODED_LEN: usize = 6usize;
17768 pub const DEFAULT: Self = Self {
17769 start: 0_u16,
17770 end: 0_u16,
17771 target_system: 0_u8,
17772 target_component: 0_u8,
17773 };
17774 #[cfg(feature = "arbitrary")]
17775 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17776 use arbitrary::{Arbitrary, Unstructured};
17777 let mut buf = [0u8; 1024];
17778 rng.fill_bytes(&mut buf);
17779 let mut unstructured = Unstructured::new(&buf);
17780 Self::arbitrary(&mut unstructured).unwrap_or_default()
17781 }
17782}
17783impl Default for LOG_REQUEST_LIST_DATA {
17784 fn default() -> Self {
17785 Self::DEFAULT.clone()
17786 }
17787}
17788impl MessageData for LOG_REQUEST_LIST_DATA {
17789 type Message = MavMessage;
17790 const ID: u32 = 117u32;
17791 const NAME: &'static str = "LOG_REQUEST_LIST";
17792 const EXTRA_CRC: u8 = 128u8;
17793 const ENCODED_LEN: usize = 6usize;
17794 fn deser(
17795 _version: MavlinkVersion,
17796 __input: &[u8],
17797 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17798 let avail_len = __input.len();
17799 let mut payload_buf = [0; Self::ENCODED_LEN];
17800 let mut buf = if avail_len < Self::ENCODED_LEN {
17801 payload_buf[0..avail_len].copy_from_slice(__input);
17802 Bytes::new(&payload_buf)
17803 } else {
17804 Bytes::new(__input)
17805 };
17806 let mut __struct = Self::default();
17807 __struct.start = buf.get_u16_le();
17808 __struct.end = buf.get_u16_le();
17809 __struct.target_system = buf.get_u8();
17810 __struct.target_component = buf.get_u8();
17811 Ok(__struct)
17812 }
17813 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17814 let mut __tmp = BytesMut::new(bytes);
17815 #[allow(clippy::absurd_extreme_comparisons)]
17816 #[allow(unused_comparisons)]
17817 if __tmp.remaining() < Self::ENCODED_LEN {
17818 panic!(
17819 "buffer is too small (need {} bytes, but got {})",
17820 Self::ENCODED_LEN,
17821 __tmp.remaining(),
17822 )
17823 }
17824 __tmp.put_u16_le(self.start);
17825 __tmp.put_u16_le(self.end);
17826 __tmp.put_u8(self.target_system);
17827 __tmp.put_u8(self.target_component);
17828 if matches!(version, MavlinkVersion::V2) {
17829 let len = __tmp.len();
17830 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17831 } else {
17832 __tmp.len()
17833 }
17834 }
17835}
17836#[doc = "id: 192"]
17837#[doc = "Reports results of completed compass calibration. Sent until MAG_CAL_ACK received."]
17838#[derive(Debug, Clone, PartialEq)]
17839#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17840#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17841pub struct MAG_CAL_REPORT_DATA {
17842 #[doc = "RMS milligauss residuals."]
17843 pub fitness: f32,
17844 #[doc = "X offset."]
17845 pub ofs_x: f32,
17846 #[doc = "Y offset."]
17847 pub ofs_y: f32,
17848 #[doc = "Z offset."]
17849 pub ofs_z: f32,
17850 #[doc = "X diagonal (matrix 11)."]
17851 pub diag_x: f32,
17852 #[doc = "Y diagonal (matrix 22)."]
17853 pub diag_y: f32,
17854 #[doc = "Z diagonal (matrix 33)."]
17855 pub diag_z: f32,
17856 #[doc = "X off-diagonal (matrix 12 and 21)."]
17857 pub offdiag_x: f32,
17858 #[doc = "Y off-diagonal (matrix 13 and 31)."]
17859 pub offdiag_y: f32,
17860 #[doc = "Z off-diagonal (matrix 32 and 23)."]
17861 pub offdiag_z: f32,
17862 #[doc = "Compass being calibrated."]
17863 pub compass_id: u8,
17864 #[doc = "Bitmask of compasses being calibrated."]
17865 pub cal_mask: u8,
17866 #[doc = "Calibration Status."]
17867 pub cal_status: MagCalStatus,
17868 #[doc = "0=requires a MAV_CMD_DO_ACCEPT_MAG_CAL, 1=saved to parameters."]
17869 pub autosaved: u8,
17870 #[doc = "Confidence in orientation (higher is better)."]
17871 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17872 pub orientation_confidence: f32,
17873 #[doc = "orientation before calibration."]
17874 #[cfg_attr(feature = "serde", serde(default))]
17875 pub old_orientation: MavSensorOrientation,
17876 #[doc = "orientation after calibration."]
17877 #[cfg_attr(feature = "serde", serde(default))]
17878 pub new_orientation: MavSensorOrientation,
17879 #[doc = "field radius correction factor"]
17880 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17881 pub scale_factor: f32,
17882}
17883impl MAG_CAL_REPORT_DATA {
17884 pub const ENCODED_LEN: usize = 54usize;
17885 pub const DEFAULT: Self = Self {
17886 fitness: 0.0_f32,
17887 ofs_x: 0.0_f32,
17888 ofs_y: 0.0_f32,
17889 ofs_z: 0.0_f32,
17890 diag_x: 0.0_f32,
17891 diag_y: 0.0_f32,
17892 diag_z: 0.0_f32,
17893 offdiag_x: 0.0_f32,
17894 offdiag_y: 0.0_f32,
17895 offdiag_z: 0.0_f32,
17896 compass_id: 0_u8,
17897 cal_mask: 0_u8,
17898 cal_status: MagCalStatus::DEFAULT,
17899 autosaved: 0_u8,
17900 orientation_confidence: 0.0_f32,
17901 old_orientation: MavSensorOrientation::DEFAULT,
17902 new_orientation: MavSensorOrientation::DEFAULT,
17903 scale_factor: 0.0_f32,
17904 };
17905 #[cfg(feature = "arbitrary")]
17906 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17907 use arbitrary::{Arbitrary, Unstructured};
17908 let mut buf = [0u8; 1024];
17909 rng.fill_bytes(&mut buf);
17910 let mut unstructured = Unstructured::new(&buf);
17911 Self::arbitrary(&mut unstructured).unwrap_or_default()
17912 }
17913}
17914impl Default for MAG_CAL_REPORT_DATA {
17915 fn default() -> Self {
17916 Self::DEFAULT.clone()
17917 }
17918}
17919impl MessageData for MAG_CAL_REPORT_DATA {
17920 type Message = MavMessage;
17921 const ID: u32 = 192u32;
17922 const NAME: &'static str = "MAG_CAL_REPORT";
17923 const EXTRA_CRC: u8 = 36u8;
17924 const ENCODED_LEN: usize = 54usize;
17925 fn deser(
17926 _version: MavlinkVersion,
17927 __input: &[u8],
17928 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17929 let avail_len = __input.len();
17930 let mut payload_buf = [0; Self::ENCODED_LEN];
17931 let mut buf = if avail_len < Self::ENCODED_LEN {
17932 payload_buf[0..avail_len].copy_from_slice(__input);
17933 Bytes::new(&payload_buf)
17934 } else {
17935 Bytes::new(__input)
17936 };
17937 let mut __struct = Self::default();
17938 __struct.fitness = buf.get_f32_le();
17939 __struct.ofs_x = buf.get_f32_le();
17940 __struct.ofs_y = buf.get_f32_le();
17941 __struct.ofs_z = buf.get_f32_le();
17942 __struct.diag_x = buf.get_f32_le();
17943 __struct.diag_y = buf.get_f32_le();
17944 __struct.diag_z = buf.get_f32_le();
17945 __struct.offdiag_x = buf.get_f32_le();
17946 __struct.offdiag_y = buf.get_f32_le();
17947 __struct.offdiag_z = buf.get_f32_le();
17948 __struct.compass_id = buf.get_u8();
17949 __struct.cal_mask = buf.get_u8();
17950 let tmp = buf.get_u8();
17951 __struct.cal_status =
17952 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
17953 enum_type: "MagCalStatus",
17954 value: tmp as u32,
17955 })?;
17956 __struct.autosaved = buf.get_u8();
17957 __struct.orientation_confidence = buf.get_f32_le();
17958 let tmp = buf.get_u8();
17959 __struct.old_orientation =
17960 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
17961 enum_type: "MavSensorOrientation",
17962 value: tmp as u32,
17963 })?;
17964 let tmp = buf.get_u8();
17965 __struct.new_orientation =
17966 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
17967 enum_type: "MavSensorOrientation",
17968 value: tmp as u32,
17969 })?;
17970 __struct.scale_factor = buf.get_f32_le();
17971 Ok(__struct)
17972 }
17973 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17974 let mut __tmp = BytesMut::new(bytes);
17975 #[allow(clippy::absurd_extreme_comparisons)]
17976 #[allow(unused_comparisons)]
17977 if __tmp.remaining() < Self::ENCODED_LEN {
17978 panic!(
17979 "buffer is too small (need {} bytes, but got {})",
17980 Self::ENCODED_LEN,
17981 __tmp.remaining(),
17982 )
17983 }
17984 __tmp.put_f32_le(self.fitness);
17985 __tmp.put_f32_le(self.ofs_x);
17986 __tmp.put_f32_le(self.ofs_y);
17987 __tmp.put_f32_le(self.ofs_z);
17988 __tmp.put_f32_le(self.diag_x);
17989 __tmp.put_f32_le(self.diag_y);
17990 __tmp.put_f32_le(self.diag_z);
17991 __tmp.put_f32_le(self.offdiag_x);
17992 __tmp.put_f32_le(self.offdiag_y);
17993 __tmp.put_f32_le(self.offdiag_z);
17994 __tmp.put_u8(self.compass_id);
17995 __tmp.put_u8(self.cal_mask);
17996 __tmp.put_u8(self.cal_status as u8);
17997 __tmp.put_u8(self.autosaved);
17998 __tmp.put_f32_le(self.orientation_confidence);
17999 __tmp.put_u8(self.old_orientation as u8);
18000 __tmp.put_u8(self.new_orientation as u8);
18001 __tmp.put_f32_le(self.scale_factor);
18002 if matches!(version, MavlinkVersion::V2) {
18003 let len = __tmp.len();
18004 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18005 } else {
18006 __tmp.len()
18007 }
18008 }
18009}
18010#[doc = "id: 69"]
18011#[doc = "This message provides an API for manually controlling the vehicle using standard joystick axes nomenclature, along with a joystick-like input device. Unused axes can be disabled and buttons states are transmitted as individual on/off bits of a bitmask."]
18012#[derive(Debug, Clone, PartialEq)]
18013#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18014#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18015pub struct MANUAL_CONTROL_DATA {
18016 #[doc = "X-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to forward(1000)-backward(-1000) movement on a joystick and the pitch of a vehicle."]
18017 pub x: i16,
18018 #[doc = "Y-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to left(-1000)-right(1000) movement on a joystick and the roll of a vehicle."]
18019 pub y: i16,
18020 #[doc = "Z-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a separate slider movement with maximum being 1000 and minimum being -1000 on a joystick and the thrust of a vehicle. Positive values are positive thrust, negative values are negative thrust."]
18021 pub z: i16,
18022 #[doc = "R-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a twisting of the joystick, with counter-clockwise being 1000 and clockwise being -1000, and the yaw of a vehicle."]
18023 pub r: i16,
18024 #[doc = "A bitfield corresponding to the joystick buttons' 0-15 current state, 1 for pressed, 0 for released. The lowest bit corresponds to Button 1."]
18025 pub buttons: u16,
18026 #[doc = "The system to be controlled."]
18027 pub target: u8,
18028 #[doc = "A bitfield corresponding to the joystick buttons' 16-31 current state, 1 for pressed, 0 for released. The lowest bit corresponds to Button 16."]
18029 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18030 pub buttons2: u16,
18031 #[doc = "Set bits to 1 to indicate which of the following extension fields contain valid data: bit 0: pitch, bit 1: roll, bit 2: aux1, bit 3: aux2, bit 4: aux3, bit 5: aux4, bit 6: aux5, bit 7: aux6"]
18032 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18033 pub enabled_extensions: u8,
18034 #[doc = "Pitch-only-axis, normalized to the range [-1000,1000]. Generally corresponds to pitch on vehicles with additional degrees of freedom. Valid if bit 0 of enabled_extensions field is set. Set to 0 if invalid."]
18035 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18036 pub s: i16,
18037 #[doc = "Roll-only-axis, normalized to the range [-1000,1000]. Generally corresponds to roll on vehicles with additional degrees of freedom. Valid if bit 1 of enabled_extensions field is set. Set to 0 if invalid."]
18038 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18039 pub t: i16,
18040 #[doc = "Aux continuous input field 1. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 2 of enabled_extensions field is set. 0 if bit 2 is unset."]
18041 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18042 pub aux1: i16,
18043 #[doc = "Aux continuous input field 2. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 3 of enabled_extensions field is set. 0 if bit 3 is unset."]
18044 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18045 pub aux2: i16,
18046 #[doc = "Aux continuous input field 3. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 4 of enabled_extensions field is set. 0 if bit 4 is unset."]
18047 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18048 pub aux3: i16,
18049 #[doc = "Aux continuous input field 4. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 5 of enabled_extensions field is set. 0 if bit 5 is unset."]
18050 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18051 pub aux4: i16,
18052 #[doc = "Aux continuous input field 5. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 6 of enabled_extensions field is set. 0 if bit 6 is unset."]
18053 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18054 pub aux5: i16,
18055 #[doc = "Aux continuous input field 6. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 7 of enabled_extensions field is set. 0 if bit 7 is unset."]
18056 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18057 pub aux6: i16,
18058}
18059impl MANUAL_CONTROL_DATA {
18060 pub const ENCODED_LEN: usize = 30usize;
18061 pub const DEFAULT: Self = Self {
18062 x: 0_i16,
18063 y: 0_i16,
18064 z: 0_i16,
18065 r: 0_i16,
18066 buttons: 0_u16,
18067 target: 0_u8,
18068 buttons2: 0_u16,
18069 enabled_extensions: 0_u8,
18070 s: 0_i16,
18071 t: 0_i16,
18072 aux1: 0_i16,
18073 aux2: 0_i16,
18074 aux3: 0_i16,
18075 aux4: 0_i16,
18076 aux5: 0_i16,
18077 aux6: 0_i16,
18078 };
18079 #[cfg(feature = "arbitrary")]
18080 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18081 use arbitrary::{Arbitrary, Unstructured};
18082 let mut buf = [0u8; 1024];
18083 rng.fill_bytes(&mut buf);
18084 let mut unstructured = Unstructured::new(&buf);
18085 Self::arbitrary(&mut unstructured).unwrap_or_default()
18086 }
18087}
18088impl Default for MANUAL_CONTROL_DATA {
18089 fn default() -> Self {
18090 Self::DEFAULT.clone()
18091 }
18092}
18093impl MessageData for MANUAL_CONTROL_DATA {
18094 type Message = MavMessage;
18095 const ID: u32 = 69u32;
18096 const NAME: &'static str = "MANUAL_CONTROL";
18097 const EXTRA_CRC: u8 = 243u8;
18098 const ENCODED_LEN: usize = 30usize;
18099 fn deser(
18100 _version: MavlinkVersion,
18101 __input: &[u8],
18102 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18103 let avail_len = __input.len();
18104 let mut payload_buf = [0; Self::ENCODED_LEN];
18105 let mut buf = if avail_len < Self::ENCODED_LEN {
18106 payload_buf[0..avail_len].copy_from_slice(__input);
18107 Bytes::new(&payload_buf)
18108 } else {
18109 Bytes::new(__input)
18110 };
18111 let mut __struct = Self::default();
18112 __struct.x = buf.get_i16_le();
18113 __struct.y = buf.get_i16_le();
18114 __struct.z = buf.get_i16_le();
18115 __struct.r = buf.get_i16_le();
18116 __struct.buttons = buf.get_u16_le();
18117 __struct.target = buf.get_u8();
18118 __struct.buttons2 = buf.get_u16_le();
18119 __struct.enabled_extensions = buf.get_u8();
18120 __struct.s = buf.get_i16_le();
18121 __struct.t = buf.get_i16_le();
18122 __struct.aux1 = buf.get_i16_le();
18123 __struct.aux2 = buf.get_i16_le();
18124 __struct.aux3 = buf.get_i16_le();
18125 __struct.aux4 = buf.get_i16_le();
18126 __struct.aux5 = buf.get_i16_le();
18127 __struct.aux6 = buf.get_i16_le();
18128 Ok(__struct)
18129 }
18130 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18131 let mut __tmp = BytesMut::new(bytes);
18132 #[allow(clippy::absurd_extreme_comparisons)]
18133 #[allow(unused_comparisons)]
18134 if __tmp.remaining() < Self::ENCODED_LEN {
18135 panic!(
18136 "buffer is too small (need {} bytes, but got {})",
18137 Self::ENCODED_LEN,
18138 __tmp.remaining(),
18139 )
18140 }
18141 __tmp.put_i16_le(self.x);
18142 __tmp.put_i16_le(self.y);
18143 __tmp.put_i16_le(self.z);
18144 __tmp.put_i16_le(self.r);
18145 __tmp.put_u16_le(self.buttons);
18146 __tmp.put_u8(self.target);
18147 __tmp.put_u16_le(self.buttons2);
18148 __tmp.put_u8(self.enabled_extensions);
18149 __tmp.put_i16_le(self.s);
18150 __tmp.put_i16_le(self.t);
18151 __tmp.put_i16_le(self.aux1);
18152 __tmp.put_i16_le(self.aux2);
18153 __tmp.put_i16_le(self.aux3);
18154 __tmp.put_i16_le(self.aux4);
18155 __tmp.put_i16_le(self.aux5);
18156 __tmp.put_i16_le(self.aux6);
18157 if matches!(version, MavlinkVersion::V2) {
18158 let len = __tmp.len();
18159 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18160 } else {
18161 __tmp.len()
18162 }
18163 }
18164}
18165#[doc = "id: 81"]
18166#[doc = "Setpoint in roll, pitch, yaw and thrust from the operator."]
18167#[derive(Debug, Clone, PartialEq)]
18168#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18169#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18170pub struct MANUAL_SETPOINT_DATA {
18171 #[doc = "Timestamp (time since system boot)."]
18172 pub time_boot_ms: u32,
18173 #[doc = "Desired roll rate"]
18174 pub roll: f32,
18175 #[doc = "Desired pitch rate"]
18176 pub pitch: f32,
18177 #[doc = "Desired yaw rate"]
18178 pub yaw: f32,
18179 #[doc = "Collective thrust, normalized to 0 .. 1"]
18180 pub thrust: f32,
18181 #[doc = "Flight mode switch position, 0.. 255"]
18182 pub mode_switch: u8,
18183 #[doc = "Override mode switch position, 0.. 255"]
18184 pub manual_override_switch: u8,
18185}
18186impl MANUAL_SETPOINT_DATA {
18187 pub const ENCODED_LEN: usize = 22usize;
18188 pub const DEFAULT: Self = Self {
18189 time_boot_ms: 0_u32,
18190 roll: 0.0_f32,
18191 pitch: 0.0_f32,
18192 yaw: 0.0_f32,
18193 thrust: 0.0_f32,
18194 mode_switch: 0_u8,
18195 manual_override_switch: 0_u8,
18196 };
18197 #[cfg(feature = "arbitrary")]
18198 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18199 use arbitrary::{Arbitrary, Unstructured};
18200 let mut buf = [0u8; 1024];
18201 rng.fill_bytes(&mut buf);
18202 let mut unstructured = Unstructured::new(&buf);
18203 Self::arbitrary(&mut unstructured).unwrap_or_default()
18204 }
18205}
18206impl Default for MANUAL_SETPOINT_DATA {
18207 fn default() -> Self {
18208 Self::DEFAULT.clone()
18209 }
18210}
18211impl MessageData for MANUAL_SETPOINT_DATA {
18212 type Message = MavMessage;
18213 const ID: u32 = 81u32;
18214 const NAME: &'static str = "MANUAL_SETPOINT";
18215 const EXTRA_CRC: u8 = 106u8;
18216 const ENCODED_LEN: usize = 22usize;
18217 fn deser(
18218 _version: MavlinkVersion,
18219 __input: &[u8],
18220 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18221 let avail_len = __input.len();
18222 let mut payload_buf = [0; Self::ENCODED_LEN];
18223 let mut buf = if avail_len < Self::ENCODED_LEN {
18224 payload_buf[0..avail_len].copy_from_slice(__input);
18225 Bytes::new(&payload_buf)
18226 } else {
18227 Bytes::new(__input)
18228 };
18229 let mut __struct = Self::default();
18230 __struct.time_boot_ms = buf.get_u32_le();
18231 __struct.roll = buf.get_f32_le();
18232 __struct.pitch = buf.get_f32_le();
18233 __struct.yaw = buf.get_f32_le();
18234 __struct.thrust = buf.get_f32_le();
18235 __struct.mode_switch = buf.get_u8();
18236 __struct.manual_override_switch = buf.get_u8();
18237 Ok(__struct)
18238 }
18239 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18240 let mut __tmp = BytesMut::new(bytes);
18241 #[allow(clippy::absurd_extreme_comparisons)]
18242 #[allow(unused_comparisons)]
18243 if __tmp.remaining() < Self::ENCODED_LEN {
18244 panic!(
18245 "buffer is too small (need {} bytes, but got {})",
18246 Self::ENCODED_LEN,
18247 __tmp.remaining(),
18248 )
18249 }
18250 __tmp.put_u32_le(self.time_boot_ms);
18251 __tmp.put_f32_le(self.roll);
18252 __tmp.put_f32_le(self.pitch);
18253 __tmp.put_f32_le(self.yaw);
18254 __tmp.put_f32_le(self.thrust);
18255 __tmp.put_u8(self.mode_switch);
18256 __tmp.put_u8(self.manual_override_switch);
18257 if matches!(version, MavlinkVersion::V2) {
18258 let len = __tmp.len();
18259 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18260 } else {
18261 __tmp.len()
18262 }
18263 }
18264}
18265#[doc = "id: 249"]
18266#[doc = "Send raw controller memory. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
18267#[derive(Debug, Clone, PartialEq)]
18268#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18269#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18270pub struct MEMORY_VECT_DATA {
18271 #[doc = "Starting address of the debug variables"]
18272 pub address: u16,
18273 #[doc = "Version code of the type variable. 0=unknown, type ignored and assumed int16_t. 1=as below"]
18274 pub ver: u8,
18275 #[doc = "Type code of the memory variables. for ver = 1: 0=16 x int16_t, 1=16 x uint16_t, 2=16 x Q15, 3=16 x 1Q14"]
18276 pub mavtype: u8,
18277 #[doc = "Memory contents at specified address"]
18278 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
18279 pub value: [i8; 32],
18280}
18281impl MEMORY_VECT_DATA {
18282 pub const ENCODED_LEN: usize = 36usize;
18283 pub const DEFAULT: Self = Self {
18284 address: 0_u16,
18285 ver: 0_u8,
18286 mavtype: 0_u8,
18287 value: [0_i8; 32usize],
18288 };
18289 #[cfg(feature = "arbitrary")]
18290 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18291 use arbitrary::{Arbitrary, Unstructured};
18292 let mut buf = [0u8; 1024];
18293 rng.fill_bytes(&mut buf);
18294 let mut unstructured = Unstructured::new(&buf);
18295 Self::arbitrary(&mut unstructured).unwrap_or_default()
18296 }
18297}
18298impl Default for MEMORY_VECT_DATA {
18299 fn default() -> Self {
18300 Self::DEFAULT.clone()
18301 }
18302}
18303impl MessageData for MEMORY_VECT_DATA {
18304 type Message = MavMessage;
18305 const ID: u32 = 249u32;
18306 const NAME: &'static str = "MEMORY_VECT";
18307 const EXTRA_CRC: u8 = 204u8;
18308 const ENCODED_LEN: usize = 36usize;
18309 fn deser(
18310 _version: MavlinkVersion,
18311 __input: &[u8],
18312 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18313 let avail_len = __input.len();
18314 let mut payload_buf = [0; Self::ENCODED_LEN];
18315 let mut buf = if avail_len < Self::ENCODED_LEN {
18316 payload_buf[0..avail_len].copy_from_slice(__input);
18317 Bytes::new(&payload_buf)
18318 } else {
18319 Bytes::new(__input)
18320 };
18321 let mut __struct = Self::default();
18322 __struct.address = buf.get_u16_le();
18323 __struct.ver = buf.get_u8();
18324 __struct.mavtype = buf.get_u8();
18325 for v in &mut __struct.value {
18326 let val = buf.get_i8();
18327 *v = val;
18328 }
18329 Ok(__struct)
18330 }
18331 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18332 let mut __tmp = BytesMut::new(bytes);
18333 #[allow(clippy::absurd_extreme_comparisons)]
18334 #[allow(unused_comparisons)]
18335 if __tmp.remaining() < Self::ENCODED_LEN {
18336 panic!(
18337 "buffer is too small (need {} bytes, but got {})",
18338 Self::ENCODED_LEN,
18339 __tmp.remaining(),
18340 )
18341 }
18342 __tmp.put_u16_le(self.address);
18343 __tmp.put_u8(self.ver);
18344 __tmp.put_u8(self.mavtype);
18345 for val in &self.value {
18346 __tmp.put_i8(*val);
18347 }
18348 if matches!(version, MavlinkVersion::V2) {
18349 let len = __tmp.len();
18350 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18351 } else {
18352 __tmp.len()
18353 }
18354 }
18355}
18356#[doc = "id: 244"]
18357#[doc = "The interval between messages for a particular MAVLink message ID. This message is sent in response to the MAV_CMD_REQUEST_MESSAGE command with param1=244 (this message) and param2=message_id (the id of the message for which the interval is required). \tIt may also be sent in response to MAV_CMD_GET_MESSAGE_INTERVAL. \tThis interface replaces DATA_STREAM."]
18358#[derive(Debug, Clone, PartialEq)]
18359#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18360#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18361pub struct MESSAGE_INTERVAL_DATA {
18362 #[doc = "0 indicates the interval at which it is sent."]
18363 pub interval_us: i32,
18364 #[doc = "The ID of the requested MAVLink message. v1.0 is limited to 254 messages."]
18365 pub message_id: u16,
18366}
18367impl MESSAGE_INTERVAL_DATA {
18368 pub const ENCODED_LEN: usize = 6usize;
18369 pub const DEFAULT: Self = Self {
18370 interval_us: 0_i32,
18371 message_id: 0_u16,
18372 };
18373 #[cfg(feature = "arbitrary")]
18374 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18375 use arbitrary::{Arbitrary, Unstructured};
18376 let mut buf = [0u8; 1024];
18377 rng.fill_bytes(&mut buf);
18378 let mut unstructured = Unstructured::new(&buf);
18379 Self::arbitrary(&mut unstructured).unwrap_or_default()
18380 }
18381}
18382impl Default for MESSAGE_INTERVAL_DATA {
18383 fn default() -> Self {
18384 Self::DEFAULT.clone()
18385 }
18386}
18387impl MessageData for MESSAGE_INTERVAL_DATA {
18388 type Message = MavMessage;
18389 const ID: u32 = 244u32;
18390 const NAME: &'static str = "MESSAGE_INTERVAL";
18391 const EXTRA_CRC: u8 = 95u8;
18392 const ENCODED_LEN: usize = 6usize;
18393 fn deser(
18394 _version: MavlinkVersion,
18395 __input: &[u8],
18396 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18397 let avail_len = __input.len();
18398 let mut payload_buf = [0; Self::ENCODED_LEN];
18399 let mut buf = if avail_len < Self::ENCODED_LEN {
18400 payload_buf[0..avail_len].copy_from_slice(__input);
18401 Bytes::new(&payload_buf)
18402 } else {
18403 Bytes::new(__input)
18404 };
18405 let mut __struct = Self::default();
18406 __struct.interval_us = buf.get_i32_le();
18407 __struct.message_id = buf.get_u16_le();
18408 Ok(__struct)
18409 }
18410 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18411 let mut __tmp = BytesMut::new(bytes);
18412 #[allow(clippy::absurd_extreme_comparisons)]
18413 #[allow(unused_comparisons)]
18414 if __tmp.remaining() < Self::ENCODED_LEN {
18415 panic!(
18416 "buffer is too small (need {} bytes, but got {})",
18417 Self::ENCODED_LEN,
18418 __tmp.remaining(),
18419 )
18420 }
18421 __tmp.put_i32_le(self.interval_us);
18422 __tmp.put_u16_le(self.message_id);
18423 if matches!(version, MavlinkVersion::V2) {
18424 let len = __tmp.len();
18425 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18426 } else {
18427 __tmp.len()
18428 }
18429 }
18430}
18431#[doc = "id: 47"]
18432#[doc = "Acknowledgment message during waypoint handling. The type field states if this message is a positive ack (type=0) or if an error happened (type=non-zero)."]
18433#[derive(Debug, Clone, PartialEq)]
18434#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18435#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18436pub struct MISSION_ACK_DATA {
18437 #[doc = "System ID"]
18438 pub target_system: u8,
18439 #[doc = "Component ID"]
18440 pub target_component: u8,
18441 #[doc = "Mission result."]
18442 pub mavtype: MavMissionResult,
18443 #[doc = "Mission type."]
18444 #[cfg_attr(feature = "serde", serde(default))]
18445 pub mission_type: MavMissionType,
18446 #[doc = "Id of new on-vehicle mission, fence, or rally point plan (on upload to vehicle). The id is calculated and returned by a vehicle when a new plan is uploaded by a GCS. The only requirement on the id is that it must change when there is any change to the on-vehicle plan type (there is no requirement that the id be globally unique). 0 on download from the vehicle to the GCS (on download the ID is set in MISSION_COUNT). 0 if plan ids are not supported. The current on-vehicle plan ids are streamed in `MISSION_CURRENT`, allowing a GCS to determine if any part of the plan has changed and needs to be re-uploaded."]
18447 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18448 pub opaque_id: u32,
18449}
18450impl MISSION_ACK_DATA {
18451 pub const ENCODED_LEN: usize = 8usize;
18452 pub const DEFAULT: Self = Self {
18453 target_system: 0_u8,
18454 target_component: 0_u8,
18455 mavtype: MavMissionResult::DEFAULT,
18456 mission_type: MavMissionType::DEFAULT,
18457 opaque_id: 0_u32,
18458 };
18459 #[cfg(feature = "arbitrary")]
18460 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18461 use arbitrary::{Arbitrary, Unstructured};
18462 let mut buf = [0u8; 1024];
18463 rng.fill_bytes(&mut buf);
18464 let mut unstructured = Unstructured::new(&buf);
18465 Self::arbitrary(&mut unstructured).unwrap_or_default()
18466 }
18467}
18468impl Default for MISSION_ACK_DATA {
18469 fn default() -> Self {
18470 Self::DEFAULT.clone()
18471 }
18472}
18473impl MessageData for MISSION_ACK_DATA {
18474 type Message = MavMessage;
18475 const ID: u32 = 47u32;
18476 const NAME: &'static str = "MISSION_ACK";
18477 const EXTRA_CRC: u8 = 153u8;
18478 const ENCODED_LEN: usize = 8usize;
18479 fn deser(
18480 _version: MavlinkVersion,
18481 __input: &[u8],
18482 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18483 let avail_len = __input.len();
18484 let mut payload_buf = [0; Self::ENCODED_LEN];
18485 let mut buf = if avail_len < Self::ENCODED_LEN {
18486 payload_buf[0..avail_len].copy_from_slice(__input);
18487 Bytes::new(&payload_buf)
18488 } else {
18489 Bytes::new(__input)
18490 };
18491 let mut __struct = Self::default();
18492 __struct.target_system = buf.get_u8();
18493 __struct.target_component = buf.get_u8();
18494 let tmp = buf.get_u8();
18495 __struct.mavtype =
18496 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18497 enum_type: "MavMissionResult",
18498 value: tmp as u32,
18499 })?;
18500 let tmp = buf.get_u8();
18501 __struct.mission_type =
18502 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18503 enum_type: "MavMissionType",
18504 value: tmp as u32,
18505 })?;
18506 __struct.opaque_id = buf.get_u32_le();
18507 Ok(__struct)
18508 }
18509 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18510 let mut __tmp = BytesMut::new(bytes);
18511 #[allow(clippy::absurd_extreme_comparisons)]
18512 #[allow(unused_comparisons)]
18513 if __tmp.remaining() < Self::ENCODED_LEN {
18514 panic!(
18515 "buffer is too small (need {} bytes, but got {})",
18516 Self::ENCODED_LEN,
18517 __tmp.remaining(),
18518 )
18519 }
18520 __tmp.put_u8(self.target_system);
18521 __tmp.put_u8(self.target_component);
18522 __tmp.put_u8(self.mavtype as u8);
18523 __tmp.put_u8(self.mission_type as u8);
18524 __tmp.put_u32_le(self.opaque_id);
18525 if matches!(version, MavlinkVersion::V2) {
18526 let len = __tmp.len();
18527 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18528 } else {
18529 __tmp.len()
18530 }
18531 }
18532}
18533#[doc = "id: 45"]
18534#[doc = "Delete all mission items at once."]
18535#[derive(Debug, Clone, PartialEq)]
18536#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18537#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18538pub struct MISSION_CLEAR_ALL_DATA {
18539 #[doc = "System ID"]
18540 pub target_system: u8,
18541 #[doc = "Component ID"]
18542 pub target_component: u8,
18543 #[doc = "Mission type."]
18544 #[cfg_attr(feature = "serde", serde(default))]
18545 pub mission_type: MavMissionType,
18546}
18547impl MISSION_CLEAR_ALL_DATA {
18548 pub const ENCODED_LEN: usize = 3usize;
18549 pub const DEFAULT: Self = Self {
18550 target_system: 0_u8,
18551 target_component: 0_u8,
18552 mission_type: MavMissionType::DEFAULT,
18553 };
18554 #[cfg(feature = "arbitrary")]
18555 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18556 use arbitrary::{Arbitrary, Unstructured};
18557 let mut buf = [0u8; 1024];
18558 rng.fill_bytes(&mut buf);
18559 let mut unstructured = Unstructured::new(&buf);
18560 Self::arbitrary(&mut unstructured).unwrap_or_default()
18561 }
18562}
18563impl Default for MISSION_CLEAR_ALL_DATA {
18564 fn default() -> Self {
18565 Self::DEFAULT.clone()
18566 }
18567}
18568impl MessageData for MISSION_CLEAR_ALL_DATA {
18569 type Message = MavMessage;
18570 const ID: u32 = 45u32;
18571 const NAME: &'static str = "MISSION_CLEAR_ALL";
18572 const EXTRA_CRC: u8 = 232u8;
18573 const ENCODED_LEN: usize = 3usize;
18574 fn deser(
18575 _version: MavlinkVersion,
18576 __input: &[u8],
18577 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18578 let avail_len = __input.len();
18579 let mut payload_buf = [0; Self::ENCODED_LEN];
18580 let mut buf = if avail_len < Self::ENCODED_LEN {
18581 payload_buf[0..avail_len].copy_from_slice(__input);
18582 Bytes::new(&payload_buf)
18583 } else {
18584 Bytes::new(__input)
18585 };
18586 let mut __struct = Self::default();
18587 __struct.target_system = buf.get_u8();
18588 __struct.target_component = buf.get_u8();
18589 let tmp = buf.get_u8();
18590 __struct.mission_type =
18591 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18592 enum_type: "MavMissionType",
18593 value: tmp as u32,
18594 })?;
18595 Ok(__struct)
18596 }
18597 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18598 let mut __tmp = BytesMut::new(bytes);
18599 #[allow(clippy::absurd_extreme_comparisons)]
18600 #[allow(unused_comparisons)]
18601 if __tmp.remaining() < Self::ENCODED_LEN {
18602 panic!(
18603 "buffer is too small (need {} bytes, but got {})",
18604 Self::ENCODED_LEN,
18605 __tmp.remaining(),
18606 )
18607 }
18608 __tmp.put_u8(self.target_system);
18609 __tmp.put_u8(self.target_component);
18610 __tmp.put_u8(self.mission_type as u8);
18611 if matches!(version, MavlinkVersion::V2) {
18612 let len = __tmp.len();
18613 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18614 } else {
18615 __tmp.len()
18616 }
18617 }
18618}
18619#[doc = "id: 44"]
18620#[doc = "This message is emitted as response to MISSION_REQUEST_LIST by the MAV and to initiate a write transaction. The GCS can then request the individual mission item based on the knowledge of the total number of waypoints."]
18621#[derive(Debug, Clone, PartialEq)]
18622#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18623#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18624pub struct MISSION_COUNT_DATA {
18625 #[doc = "Number of mission items in the sequence"]
18626 pub count: u16,
18627 #[doc = "System ID"]
18628 pub target_system: u8,
18629 #[doc = "Component ID"]
18630 pub target_component: u8,
18631 #[doc = "Mission type."]
18632 #[cfg_attr(feature = "serde", serde(default))]
18633 pub mission_type: MavMissionType,
18634 #[doc = "Id of current on-vehicle mission, fence, or rally point plan (on download from vehicle). This field is used when downloading a plan from a vehicle to a GCS. 0 on upload to the vehicle from GCS. 0 if plan ids are not supported. The current on-vehicle plan ids are streamed in `MISSION_CURRENT`, allowing a GCS to determine if any part of the plan has changed and needs to be re-uploaded. The ids are recalculated by the vehicle when any part of the on-vehicle plan changes (when a new plan is uploaded, the vehicle returns the new id to the GCS in MISSION_ACK)."]
18635 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18636 pub opaque_id: u32,
18637}
18638impl MISSION_COUNT_DATA {
18639 pub const ENCODED_LEN: usize = 9usize;
18640 pub const DEFAULT: Self = Self {
18641 count: 0_u16,
18642 target_system: 0_u8,
18643 target_component: 0_u8,
18644 mission_type: MavMissionType::DEFAULT,
18645 opaque_id: 0_u32,
18646 };
18647 #[cfg(feature = "arbitrary")]
18648 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18649 use arbitrary::{Arbitrary, Unstructured};
18650 let mut buf = [0u8; 1024];
18651 rng.fill_bytes(&mut buf);
18652 let mut unstructured = Unstructured::new(&buf);
18653 Self::arbitrary(&mut unstructured).unwrap_or_default()
18654 }
18655}
18656impl Default for MISSION_COUNT_DATA {
18657 fn default() -> Self {
18658 Self::DEFAULT.clone()
18659 }
18660}
18661impl MessageData for MISSION_COUNT_DATA {
18662 type Message = MavMessage;
18663 const ID: u32 = 44u32;
18664 const NAME: &'static str = "MISSION_COUNT";
18665 const EXTRA_CRC: u8 = 221u8;
18666 const ENCODED_LEN: usize = 9usize;
18667 fn deser(
18668 _version: MavlinkVersion,
18669 __input: &[u8],
18670 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18671 let avail_len = __input.len();
18672 let mut payload_buf = [0; Self::ENCODED_LEN];
18673 let mut buf = if avail_len < Self::ENCODED_LEN {
18674 payload_buf[0..avail_len].copy_from_slice(__input);
18675 Bytes::new(&payload_buf)
18676 } else {
18677 Bytes::new(__input)
18678 };
18679 let mut __struct = Self::default();
18680 __struct.count = buf.get_u16_le();
18681 __struct.target_system = buf.get_u8();
18682 __struct.target_component = buf.get_u8();
18683 let tmp = buf.get_u8();
18684 __struct.mission_type =
18685 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18686 enum_type: "MavMissionType",
18687 value: tmp as u32,
18688 })?;
18689 __struct.opaque_id = buf.get_u32_le();
18690 Ok(__struct)
18691 }
18692 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18693 let mut __tmp = BytesMut::new(bytes);
18694 #[allow(clippy::absurd_extreme_comparisons)]
18695 #[allow(unused_comparisons)]
18696 if __tmp.remaining() < Self::ENCODED_LEN {
18697 panic!(
18698 "buffer is too small (need {} bytes, but got {})",
18699 Self::ENCODED_LEN,
18700 __tmp.remaining(),
18701 )
18702 }
18703 __tmp.put_u16_le(self.count);
18704 __tmp.put_u8(self.target_system);
18705 __tmp.put_u8(self.target_component);
18706 __tmp.put_u8(self.mission_type as u8);
18707 __tmp.put_u32_le(self.opaque_id);
18708 if matches!(version, MavlinkVersion::V2) {
18709 let len = __tmp.len();
18710 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18711 } else {
18712 __tmp.len()
18713 }
18714 }
18715}
18716#[doc = "id: 42"]
18717#[doc = "Message that announces the sequence number of the current target mission item (that the system will fly towards/execute when the mission is running). This message should be streamed all the time (nominally at 1Hz). This message should be emitted following a call to MAV_CMD_DO_SET_MISSION_CURRENT or MISSION_SET_CURRENT."]
18718#[derive(Debug, Clone, PartialEq)]
18719#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18720#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18721pub struct MISSION_CURRENT_DATA {
18722 #[doc = "Sequence"]
18723 pub seq: u16,
18724 #[doc = "Total number of mission items on vehicle (on last item, sequence == total). If the autopilot stores its home location as part of the mission this will be excluded from the total. 0: Not supported, UINT16_MAX if no mission is present on the vehicle."]
18725 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18726 pub total: u16,
18727 #[doc = "Mission state machine state. MISSION_STATE_UNKNOWN if state reporting not supported."]
18728 #[cfg_attr(feature = "serde", serde(default))]
18729 pub mission_state: MissionState,
18730 #[doc = "Vehicle is in a mode that can execute mission items or suspended. 0: Unknown, 1: In mission mode, 2: Suspended (not in mission mode)."]
18731 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18732 pub mission_mode: u8,
18733 #[doc = "Id of current on-vehicle mission plan, or 0 if IDs are not supported or there is no mission loaded. GCS can use this to track changes to the mission plan type. The same value is returned on mission upload (in the MISSION_ACK)."]
18734 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18735 pub mission_id: u32,
18736 #[doc = "Id of current on-vehicle fence plan, or 0 if IDs are not supported or there is no fence loaded. GCS can use this to track changes to the fence plan type. The same value is returned on fence upload (in the MISSION_ACK)."]
18737 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18738 pub fence_id: u32,
18739 #[doc = "Id of current on-vehicle rally point plan, or 0 if IDs are not supported or there are no rally points loaded. GCS can use this to track changes to the rally point plan type. The same value is returned on rally point upload (in the MISSION_ACK)."]
18740 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18741 pub rally_points_id: u32,
18742}
18743impl MISSION_CURRENT_DATA {
18744 pub const ENCODED_LEN: usize = 18usize;
18745 pub const DEFAULT: Self = Self {
18746 seq: 0_u16,
18747 total: 0_u16,
18748 mission_state: MissionState::DEFAULT,
18749 mission_mode: 0_u8,
18750 mission_id: 0_u32,
18751 fence_id: 0_u32,
18752 rally_points_id: 0_u32,
18753 };
18754 #[cfg(feature = "arbitrary")]
18755 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18756 use arbitrary::{Arbitrary, Unstructured};
18757 let mut buf = [0u8; 1024];
18758 rng.fill_bytes(&mut buf);
18759 let mut unstructured = Unstructured::new(&buf);
18760 Self::arbitrary(&mut unstructured).unwrap_or_default()
18761 }
18762}
18763impl Default for MISSION_CURRENT_DATA {
18764 fn default() -> Self {
18765 Self::DEFAULT.clone()
18766 }
18767}
18768impl MessageData for MISSION_CURRENT_DATA {
18769 type Message = MavMessage;
18770 const ID: u32 = 42u32;
18771 const NAME: &'static str = "MISSION_CURRENT";
18772 const EXTRA_CRC: u8 = 28u8;
18773 const ENCODED_LEN: usize = 18usize;
18774 fn deser(
18775 _version: MavlinkVersion,
18776 __input: &[u8],
18777 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18778 let avail_len = __input.len();
18779 let mut payload_buf = [0; Self::ENCODED_LEN];
18780 let mut buf = if avail_len < Self::ENCODED_LEN {
18781 payload_buf[0..avail_len].copy_from_slice(__input);
18782 Bytes::new(&payload_buf)
18783 } else {
18784 Bytes::new(__input)
18785 };
18786 let mut __struct = Self::default();
18787 __struct.seq = buf.get_u16_le();
18788 __struct.total = buf.get_u16_le();
18789 let tmp = buf.get_u8();
18790 __struct.mission_state =
18791 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18792 enum_type: "MissionState",
18793 value: tmp as u32,
18794 })?;
18795 __struct.mission_mode = buf.get_u8();
18796 __struct.mission_id = buf.get_u32_le();
18797 __struct.fence_id = buf.get_u32_le();
18798 __struct.rally_points_id = buf.get_u32_le();
18799 Ok(__struct)
18800 }
18801 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18802 let mut __tmp = BytesMut::new(bytes);
18803 #[allow(clippy::absurd_extreme_comparisons)]
18804 #[allow(unused_comparisons)]
18805 if __tmp.remaining() < Self::ENCODED_LEN {
18806 panic!(
18807 "buffer is too small (need {} bytes, but got {})",
18808 Self::ENCODED_LEN,
18809 __tmp.remaining(),
18810 )
18811 }
18812 __tmp.put_u16_le(self.seq);
18813 __tmp.put_u16_le(self.total);
18814 __tmp.put_u8(self.mission_state as u8);
18815 __tmp.put_u8(self.mission_mode);
18816 __tmp.put_u32_le(self.mission_id);
18817 __tmp.put_u32_le(self.fence_id);
18818 __tmp.put_u32_le(self.rally_points_id);
18819 if matches!(version, MavlinkVersion::V2) {
18820 let len = __tmp.len();
18821 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18822 } else {
18823 __tmp.len()
18824 }
18825 }
18826}
18827#[deprecated = " See `MISSION_ITEM_INT` (Deprecated since 2020-06)"]
18828#[doc = "id: 39"]
18829#[doc = "Message encoding a mission item. This message is emitted to announce the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). NaN may be used to indicate an optional/default value (e.g. to use the system's current latitude or yaw rather than a specific value). See also <https://mavlink.io/en/services/mission.html>."]
18830#[derive(Debug, Clone, PartialEq)]
18831#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18832#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18833pub struct MISSION_ITEM_DATA {
18834 #[doc = "PARAM1, see MAV_CMD enum"]
18835 pub param1: f32,
18836 #[doc = "PARAM2, see MAV_CMD enum"]
18837 pub param2: f32,
18838 #[doc = "PARAM3, see MAV_CMD enum"]
18839 pub param3: f32,
18840 #[doc = "PARAM4, see MAV_CMD enum"]
18841 pub param4: f32,
18842 #[doc = "PARAM5 / local: X coordinate, global: latitude"]
18843 pub x: f32,
18844 #[doc = "PARAM6 / local: Y coordinate, global: longitude"]
18845 pub y: f32,
18846 #[doc = "PARAM7 / local: Z coordinate, global: altitude (relative or absolute, depending on frame)."]
18847 pub z: f32,
18848 #[doc = "Sequence"]
18849 pub seq: u16,
18850 #[doc = "The scheduled action for the waypoint."]
18851 pub command: MavCmd,
18852 #[doc = "System ID"]
18853 pub target_system: u8,
18854 #[doc = "Component ID"]
18855 pub target_component: u8,
18856 #[doc = "The coordinate system of the waypoint."]
18857 pub frame: MavFrame,
18858 #[doc = "false:0, true:1"]
18859 pub current: u8,
18860 #[doc = "Autocontinue to next waypoint. 0: false, 1: true. Set false to pause mission after the item completes."]
18861 pub autocontinue: u8,
18862 #[doc = "Mission type."]
18863 #[cfg_attr(feature = "serde", serde(default))]
18864 pub mission_type: MavMissionType,
18865}
18866impl MISSION_ITEM_DATA {
18867 pub const ENCODED_LEN: usize = 38usize;
18868 pub const DEFAULT: Self = Self {
18869 param1: 0.0_f32,
18870 param2: 0.0_f32,
18871 param3: 0.0_f32,
18872 param4: 0.0_f32,
18873 x: 0.0_f32,
18874 y: 0.0_f32,
18875 z: 0.0_f32,
18876 seq: 0_u16,
18877 command: MavCmd::DEFAULT,
18878 target_system: 0_u8,
18879 target_component: 0_u8,
18880 frame: MavFrame::DEFAULT,
18881 current: 0_u8,
18882 autocontinue: 0_u8,
18883 mission_type: MavMissionType::DEFAULT,
18884 };
18885 #[cfg(feature = "arbitrary")]
18886 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18887 use arbitrary::{Arbitrary, Unstructured};
18888 let mut buf = [0u8; 1024];
18889 rng.fill_bytes(&mut buf);
18890 let mut unstructured = Unstructured::new(&buf);
18891 Self::arbitrary(&mut unstructured).unwrap_or_default()
18892 }
18893}
18894impl Default for MISSION_ITEM_DATA {
18895 fn default() -> Self {
18896 Self::DEFAULT.clone()
18897 }
18898}
18899impl MessageData for MISSION_ITEM_DATA {
18900 type Message = MavMessage;
18901 const ID: u32 = 39u32;
18902 const NAME: &'static str = "MISSION_ITEM";
18903 const EXTRA_CRC: u8 = 254u8;
18904 const ENCODED_LEN: usize = 38usize;
18905 fn deser(
18906 _version: MavlinkVersion,
18907 __input: &[u8],
18908 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18909 let avail_len = __input.len();
18910 let mut payload_buf = [0; Self::ENCODED_LEN];
18911 let mut buf = if avail_len < Self::ENCODED_LEN {
18912 payload_buf[0..avail_len].copy_from_slice(__input);
18913 Bytes::new(&payload_buf)
18914 } else {
18915 Bytes::new(__input)
18916 };
18917 let mut __struct = Self::default();
18918 __struct.param1 = buf.get_f32_le();
18919 __struct.param2 = buf.get_f32_le();
18920 __struct.param3 = buf.get_f32_le();
18921 __struct.param4 = buf.get_f32_le();
18922 __struct.x = buf.get_f32_le();
18923 __struct.y = buf.get_f32_le();
18924 __struct.z = buf.get_f32_le();
18925 __struct.seq = buf.get_u16_le();
18926 let tmp = buf.get_u16_le();
18927 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
18928 ::mavlink_core::error::ParserError::InvalidEnum {
18929 enum_type: "MavCmd",
18930 value: tmp as u32,
18931 },
18932 )?;
18933 __struct.target_system = buf.get_u8();
18934 __struct.target_component = buf.get_u8();
18935 let tmp = buf.get_u8();
18936 __struct.frame =
18937 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18938 enum_type: "MavFrame",
18939 value: tmp as u32,
18940 })?;
18941 __struct.current = buf.get_u8();
18942 __struct.autocontinue = buf.get_u8();
18943 let tmp = buf.get_u8();
18944 __struct.mission_type =
18945 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18946 enum_type: "MavMissionType",
18947 value: tmp as u32,
18948 })?;
18949 Ok(__struct)
18950 }
18951 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18952 let mut __tmp = BytesMut::new(bytes);
18953 #[allow(clippy::absurd_extreme_comparisons)]
18954 #[allow(unused_comparisons)]
18955 if __tmp.remaining() < Self::ENCODED_LEN {
18956 panic!(
18957 "buffer is too small (need {} bytes, but got {})",
18958 Self::ENCODED_LEN,
18959 __tmp.remaining(),
18960 )
18961 }
18962 __tmp.put_f32_le(self.param1);
18963 __tmp.put_f32_le(self.param2);
18964 __tmp.put_f32_le(self.param3);
18965 __tmp.put_f32_le(self.param4);
18966 __tmp.put_f32_le(self.x);
18967 __tmp.put_f32_le(self.y);
18968 __tmp.put_f32_le(self.z);
18969 __tmp.put_u16_le(self.seq);
18970 __tmp.put_u16_le(self.command as u16);
18971 __tmp.put_u8(self.target_system);
18972 __tmp.put_u8(self.target_component);
18973 __tmp.put_u8(self.frame as u8);
18974 __tmp.put_u8(self.current);
18975 __tmp.put_u8(self.autocontinue);
18976 __tmp.put_u8(self.mission_type as u8);
18977 if matches!(version, MavlinkVersion::V2) {
18978 let len = __tmp.len();
18979 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18980 } else {
18981 __tmp.len()
18982 }
18983 }
18984}
18985#[doc = "id: 73"]
18986#[doc = "Message encoding a mission item. This message is emitted to announce the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). NaN or INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current latitude, yaw rather than a specific value). See also <https://mavlink.io/en/services/mission.html>."]
18987#[derive(Debug, Clone, PartialEq)]
18988#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18989#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18990pub struct MISSION_ITEM_INT_DATA {
18991 #[doc = "PARAM1, see MAV_CMD enum"]
18992 pub param1: f32,
18993 #[doc = "PARAM2, see MAV_CMD enum"]
18994 pub param2: f32,
18995 #[doc = "PARAM3, see MAV_CMD enum"]
18996 pub param3: f32,
18997 #[doc = "PARAM4, see MAV_CMD enum"]
18998 pub param4: f32,
18999 #[doc = "PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7"]
19000 pub x: i32,
19001 #[doc = "PARAM6 / y position: local: x position in meters * 1e4, global: longitude in degrees *10^7"]
19002 pub y: i32,
19003 #[doc = "PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame."]
19004 pub z: f32,
19005 #[doc = "Waypoint ID (sequence number). Starts at zero. Increases monotonically for each waypoint, no gaps in the sequence (0,1,2,3,4)."]
19006 pub seq: u16,
19007 #[doc = "The scheduled action for the waypoint."]
19008 pub command: MavCmd,
19009 #[doc = "System ID"]
19010 pub target_system: u8,
19011 #[doc = "Component ID"]
19012 pub target_component: u8,
19013 #[doc = "The coordinate system of the waypoint."]
19014 pub frame: MavFrame,
19015 #[doc = "false:0, true:1"]
19016 pub current: u8,
19017 #[doc = "Autocontinue to next waypoint. 0: false, 1: true. Set false to pause mission after the item completes."]
19018 pub autocontinue: u8,
19019 #[doc = "Mission type."]
19020 #[cfg_attr(feature = "serde", serde(default))]
19021 pub mission_type: MavMissionType,
19022}
19023impl MISSION_ITEM_INT_DATA {
19024 pub const ENCODED_LEN: usize = 38usize;
19025 pub const DEFAULT: Self = Self {
19026 param1: 0.0_f32,
19027 param2: 0.0_f32,
19028 param3: 0.0_f32,
19029 param4: 0.0_f32,
19030 x: 0_i32,
19031 y: 0_i32,
19032 z: 0.0_f32,
19033 seq: 0_u16,
19034 command: MavCmd::DEFAULT,
19035 target_system: 0_u8,
19036 target_component: 0_u8,
19037 frame: MavFrame::DEFAULT,
19038 current: 0_u8,
19039 autocontinue: 0_u8,
19040 mission_type: MavMissionType::DEFAULT,
19041 };
19042 #[cfg(feature = "arbitrary")]
19043 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19044 use arbitrary::{Arbitrary, Unstructured};
19045 let mut buf = [0u8; 1024];
19046 rng.fill_bytes(&mut buf);
19047 let mut unstructured = Unstructured::new(&buf);
19048 Self::arbitrary(&mut unstructured).unwrap_or_default()
19049 }
19050}
19051impl Default for MISSION_ITEM_INT_DATA {
19052 fn default() -> Self {
19053 Self::DEFAULT.clone()
19054 }
19055}
19056impl MessageData for MISSION_ITEM_INT_DATA {
19057 type Message = MavMessage;
19058 const ID: u32 = 73u32;
19059 const NAME: &'static str = "MISSION_ITEM_INT";
19060 const EXTRA_CRC: u8 = 38u8;
19061 const ENCODED_LEN: usize = 38usize;
19062 fn deser(
19063 _version: MavlinkVersion,
19064 __input: &[u8],
19065 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19066 let avail_len = __input.len();
19067 let mut payload_buf = [0; Self::ENCODED_LEN];
19068 let mut buf = if avail_len < Self::ENCODED_LEN {
19069 payload_buf[0..avail_len].copy_from_slice(__input);
19070 Bytes::new(&payload_buf)
19071 } else {
19072 Bytes::new(__input)
19073 };
19074 let mut __struct = Self::default();
19075 __struct.param1 = buf.get_f32_le();
19076 __struct.param2 = buf.get_f32_le();
19077 __struct.param3 = buf.get_f32_le();
19078 __struct.param4 = buf.get_f32_le();
19079 __struct.x = buf.get_i32_le();
19080 __struct.y = buf.get_i32_le();
19081 __struct.z = buf.get_f32_le();
19082 __struct.seq = buf.get_u16_le();
19083 let tmp = buf.get_u16_le();
19084 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
19085 ::mavlink_core::error::ParserError::InvalidEnum {
19086 enum_type: "MavCmd",
19087 value: tmp as u32,
19088 },
19089 )?;
19090 __struct.target_system = buf.get_u8();
19091 __struct.target_component = buf.get_u8();
19092 let tmp = buf.get_u8();
19093 __struct.frame =
19094 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19095 enum_type: "MavFrame",
19096 value: tmp as u32,
19097 })?;
19098 __struct.current = buf.get_u8();
19099 __struct.autocontinue = buf.get_u8();
19100 let tmp = buf.get_u8();
19101 __struct.mission_type =
19102 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19103 enum_type: "MavMissionType",
19104 value: tmp as u32,
19105 })?;
19106 Ok(__struct)
19107 }
19108 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19109 let mut __tmp = BytesMut::new(bytes);
19110 #[allow(clippy::absurd_extreme_comparisons)]
19111 #[allow(unused_comparisons)]
19112 if __tmp.remaining() < Self::ENCODED_LEN {
19113 panic!(
19114 "buffer is too small (need {} bytes, but got {})",
19115 Self::ENCODED_LEN,
19116 __tmp.remaining(),
19117 )
19118 }
19119 __tmp.put_f32_le(self.param1);
19120 __tmp.put_f32_le(self.param2);
19121 __tmp.put_f32_le(self.param3);
19122 __tmp.put_f32_le(self.param4);
19123 __tmp.put_i32_le(self.x);
19124 __tmp.put_i32_le(self.y);
19125 __tmp.put_f32_le(self.z);
19126 __tmp.put_u16_le(self.seq);
19127 __tmp.put_u16_le(self.command as u16);
19128 __tmp.put_u8(self.target_system);
19129 __tmp.put_u8(self.target_component);
19130 __tmp.put_u8(self.frame as u8);
19131 __tmp.put_u8(self.current);
19132 __tmp.put_u8(self.autocontinue);
19133 __tmp.put_u8(self.mission_type as u8);
19134 if matches!(version, MavlinkVersion::V2) {
19135 let len = __tmp.len();
19136 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19137 } else {
19138 __tmp.len()
19139 }
19140 }
19141}
19142#[doc = "id: 46"]
19143#[doc = "A certain mission item has been reached. The system will either hold this position (or circle on the orbit) or (if the autocontinue on the WP was set) continue to the next waypoint."]
19144#[derive(Debug, Clone, PartialEq)]
19145#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19146#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19147pub struct MISSION_ITEM_REACHED_DATA {
19148 #[doc = "Sequence"]
19149 pub seq: u16,
19150}
19151impl MISSION_ITEM_REACHED_DATA {
19152 pub const ENCODED_LEN: usize = 2usize;
19153 pub const DEFAULT: Self = Self { seq: 0_u16 };
19154 #[cfg(feature = "arbitrary")]
19155 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19156 use arbitrary::{Arbitrary, Unstructured};
19157 let mut buf = [0u8; 1024];
19158 rng.fill_bytes(&mut buf);
19159 let mut unstructured = Unstructured::new(&buf);
19160 Self::arbitrary(&mut unstructured).unwrap_or_default()
19161 }
19162}
19163impl Default for MISSION_ITEM_REACHED_DATA {
19164 fn default() -> Self {
19165 Self::DEFAULT.clone()
19166 }
19167}
19168impl MessageData for MISSION_ITEM_REACHED_DATA {
19169 type Message = MavMessage;
19170 const ID: u32 = 46u32;
19171 const NAME: &'static str = "MISSION_ITEM_REACHED";
19172 const EXTRA_CRC: u8 = 11u8;
19173 const ENCODED_LEN: usize = 2usize;
19174 fn deser(
19175 _version: MavlinkVersion,
19176 __input: &[u8],
19177 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19178 let avail_len = __input.len();
19179 let mut payload_buf = [0; Self::ENCODED_LEN];
19180 let mut buf = if avail_len < Self::ENCODED_LEN {
19181 payload_buf[0..avail_len].copy_from_slice(__input);
19182 Bytes::new(&payload_buf)
19183 } else {
19184 Bytes::new(__input)
19185 };
19186 let mut __struct = Self::default();
19187 __struct.seq = buf.get_u16_le();
19188 Ok(__struct)
19189 }
19190 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19191 let mut __tmp = BytesMut::new(bytes);
19192 #[allow(clippy::absurd_extreme_comparisons)]
19193 #[allow(unused_comparisons)]
19194 if __tmp.remaining() < Self::ENCODED_LEN {
19195 panic!(
19196 "buffer is too small (need {} bytes, but got {})",
19197 Self::ENCODED_LEN,
19198 __tmp.remaining(),
19199 )
19200 }
19201 __tmp.put_u16_le(self.seq);
19202 if matches!(version, MavlinkVersion::V2) {
19203 let len = __tmp.len();
19204 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19205 } else {
19206 __tmp.len()
19207 }
19208 }
19209}
19210#[deprecated = "A system that gets this request should respond with MISSION_ITEM_INT (as though MISSION_REQUEST_INT was received). See `MISSION_REQUEST_INT` (Deprecated since 2020-06)"]
19211#[doc = "id: 40"]
19212#[doc = "Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM message. <https://mavlink.io/en/services/mission.html>."]
19213#[derive(Debug, Clone, PartialEq)]
19214#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19215#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19216pub struct MISSION_REQUEST_DATA {
19217 #[doc = "Sequence"]
19218 pub seq: u16,
19219 #[doc = "System ID"]
19220 pub target_system: u8,
19221 #[doc = "Component ID"]
19222 pub target_component: u8,
19223 #[doc = "Mission type."]
19224 #[cfg_attr(feature = "serde", serde(default))]
19225 pub mission_type: MavMissionType,
19226}
19227impl MISSION_REQUEST_DATA {
19228 pub const ENCODED_LEN: usize = 5usize;
19229 pub const DEFAULT: Self = Self {
19230 seq: 0_u16,
19231 target_system: 0_u8,
19232 target_component: 0_u8,
19233 mission_type: MavMissionType::DEFAULT,
19234 };
19235 #[cfg(feature = "arbitrary")]
19236 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19237 use arbitrary::{Arbitrary, Unstructured};
19238 let mut buf = [0u8; 1024];
19239 rng.fill_bytes(&mut buf);
19240 let mut unstructured = Unstructured::new(&buf);
19241 Self::arbitrary(&mut unstructured).unwrap_or_default()
19242 }
19243}
19244impl Default for MISSION_REQUEST_DATA {
19245 fn default() -> Self {
19246 Self::DEFAULT.clone()
19247 }
19248}
19249impl MessageData for MISSION_REQUEST_DATA {
19250 type Message = MavMessage;
19251 const ID: u32 = 40u32;
19252 const NAME: &'static str = "MISSION_REQUEST";
19253 const EXTRA_CRC: u8 = 230u8;
19254 const ENCODED_LEN: usize = 5usize;
19255 fn deser(
19256 _version: MavlinkVersion,
19257 __input: &[u8],
19258 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19259 let avail_len = __input.len();
19260 let mut payload_buf = [0; Self::ENCODED_LEN];
19261 let mut buf = if avail_len < Self::ENCODED_LEN {
19262 payload_buf[0..avail_len].copy_from_slice(__input);
19263 Bytes::new(&payload_buf)
19264 } else {
19265 Bytes::new(__input)
19266 };
19267 let mut __struct = Self::default();
19268 __struct.seq = buf.get_u16_le();
19269 __struct.target_system = buf.get_u8();
19270 __struct.target_component = buf.get_u8();
19271 let tmp = buf.get_u8();
19272 __struct.mission_type =
19273 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19274 enum_type: "MavMissionType",
19275 value: tmp as u32,
19276 })?;
19277 Ok(__struct)
19278 }
19279 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19280 let mut __tmp = BytesMut::new(bytes);
19281 #[allow(clippy::absurd_extreme_comparisons)]
19282 #[allow(unused_comparisons)]
19283 if __tmp.remaining() < Self::ENCODED_LEN {
19284 panic!(
19285 "buffer is too small (need {} bytes, but got {})",
19286 Self::ENCODED_LEN,
19287 __tmp.remaining(),
19288 )
19289 }
19290 __tmp.put_u16_le(self.seq);
19291 __tmp.put_u8(self.target_system);
19292 __tmp.put_u8(self.target_component);
19293 __tmp.put_u8(self.mission_type as u8);
19294 if matches!(version, MavlinkVersion::V2) {
19295 let len = __tmp.len();
19296 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19297 } else {
19298 __tmp.len()
19299 }
19300 }
19301}
19302#[doc = "id: 51"]
19303#[doc = "Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM_INT message. <https://mavlink.io/en/services/mission.html>."]
19304#[derive(Debug, Clone, PartialEq)]
19305#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19306#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19307pub struct MISSION_REQUEST_INT_DATA {
19308 #[doc = "Sequence"]
19309 pub seq: u16,
19310 #[doc = "System ID"]
19311 pub target_system: u8,
19312 #[doc = "Component ID"]
19313 pub target_component: u8,
19314 #[doc = "Mission type."]
19315 #[cfg_attr(feature = "serde", serde(default))]
19316 pub mission_type: MavMissionType,
19317}
19318impl MISSION_REQUEST_INT_DATA {
19319 pub const ENCODED_LEN: usize = 5usize;
19320 pub const DEFAULT: Self = Self {
19321 seq: 0_u16,
19322 target_system: 0_u8,
19323 target_component: 0_u8,
19324 mission_type: MavMissionType::DEFAULT,
19325 };
19326 #[cfg(feature = "arbitrary")]
19327 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19328 use arbitrary::{Arbitrary, Unstructured};
19329 let mut buf = [0u8; 1024];
19330 rng.fill_bytes(&mut buf);
19331 let mut unstructured = Unstructured::new(&buf);
19332 Self::arbitrary(&mut unstructured).unwrap_or_default()
19333 }
19334}
19335impl Default for MISSION_REQUEST_INT_DATA {
19336 fn default() -> Self {
19337 Self::DEFAULT.clone()
19338 }
19339}
19340impl MessageData for MISSION_REQUEST_INT_DATA {
19341 type Message = MavMessage;
19342 const ID: u32 = 51u32;
19343 const NAME: &'static str = "MISSION_REQUEST_INT";
19344 const EXTRA_CRC: u8 = 196u8;
19345 const ENCODED_LEN: usize = 5usize;
19346 fn deser(
19347 _version: MavlinkVersion,
19348 __input: &[u8],
19349 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19350 let avail_len = __input.len();
19351 let mut payload_buf = [0; Self::ENCODED_LEN];
19352 let mut buf = if avail_len < Self::ENCODED_LEN {
19353 payload_buf[0..avail_len].copy_from_slice(__input);
19354 Bytes::new(&payload_buf)
19355 } else {
19356 Bytes::new(__input)
19357 };
19358 let mut __struct = Self::default();
19359 __struct.seq = buf.get_u16_le();
19360 __struct.target_system = buf.get_u8();
19361 __struct.target_component = buf.get_u8();
19362 let tmp = buf.get_u8();
19363 __struct.mission_type =
19364 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19365 enum_type: "MavMissionType",
19366 value: tmp as u32,
19367 })?;
19368 Ok(__struct)
19369 }
19370 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19371 let mut __tmp = BytesMut::new(bytes);
19372 #[allow(clippy::absurd_extreme_comparisons)]
19373 #[allow(unused_comparisons)]
19374 if __tmp.remaining() < Self::ENCODED_LEN {
19375 panic!(
19376 "buffer is too small (need {} bytes, but got {})",
19377 Self::ENCODED_LEN,
19378 __tmp.remaining(),
19379 )
19380 }
19381 __tmp.put_u16_le(self.seq);
19382 __tmp.put_u8(self.target_system);
19383 __tmp.put_u8(self.target_component);
19384 __tmp.put_u8(self.mission_type as u8);
19385 if matches!(version, MavlinkVersion::V2) {
19386 let len = __tmp.len();
19387 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19388 } else {
19389 __tmp.len()
19390 }
19391 }
19392}
19393#[doc = "id: 43"]
19394#[doc = "Request the overall list of mission items from the system/component."]
19395#[derive(Debug, Clone, PartialEq)]
19396#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19397#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19398pub struct MISSION_REQUEST_LIST_DATA {
19399 #[doc = "System ID"]
19400 pub target_system: u8,
19401 #[doc = "Component ID"]
19402 pub target_component: u8,
19403 #[doc = "Mission type."]
19404 #[cfg_attr(feature = "serde", serde(default))]
19405 pub mission_type: MavMissionType,
19406}
19407impl MISSION_REQUEST_LIST_DATA {
19408 pub const ENCODED_LEN: usize = 3usize;
19409 pub const DEFAULT: Self = Self {
19410 target_system: 0_u8,
19411 target_component: 0_u8,
19412 mission_type: MavMissionType::DEFAULT,
19413 };
19414 #[cfg(feature = "arbitrary")]
19415 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19416 use arbitrary::{Arbitrary, Unstructured};
19417 let mut buf = [0u8; 1024];
19418 rng.fill_bytes(&mut buf);
19419 let mut unstructured = Unstructured::new(&buf);
19420 Self::arbitrary(&mut unstructured).unwrap_or_default()
19421 }
19422}
19423impl Default for MISSION_REQUEST_LIST_DATA {
19424 fn default() -> Self {
19425 Self::DEFAULT.clone()
19426 }
19427}
19428impl MessageData for MISSION_REQUEST_LIST_DATA {
19429 type Message = MavMessage;
19430 const ID: u32 = 43u32;
19431 const NAME: &'static str = "MISSION_REQUEST_LIST";
19432 const EXTRA_CRC: u8 = 132u8;
19433 const ENCODED_LEN: usize = 3usize;
19434 fn deser(
19435 _version: MavlinkVersion,
19436 __input: &[u8],
19437 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19438 let avail_len = __input.len();
19439 let mut payload_buf = [0; Self::ENCODED_LEN];
19440 let mut buf = if avail_len < Self::ENCODED_LEN {
19441 payload_buf[0..avail_len].copy_from_slice(__input);
19442 Bytes::new(&payload_buf)
19443 } else {
19444 Bytes::new(__input)
19445 };
19446 let mut __struct = Self::default();
19447 __struct.target_system = buf.get_u8();
19448 __struct.target_component = buf.get_u8();
19449 let tmp = buf.get_u8();
19450 __struct.mission_type =
19451 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19452 enum_type: "MavMissionType",
19453 value: tmp as u32,
19454 })?;
19455 Ok(__struct)
19456 }
19457 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19458 let mut __tmp = BytesMut::new(bytes);
19459 #[allow(clippy::absurd_extreme_comparisons)]
19460 #[allow(unused_comparisons)]
19461 if __tmp.remaining() < Self::ENCODED_LEN {
19462 panic!(
19463 "buffer is too small (need {} bytes, but got {})",
19464 Self::ENCODED_LEN,
19465 __tmp.remaining(),
19466 )
19467 }
19468 __tmp.put_u8(self.target_system);
19469 __tmp.put_u8(self.target_component);
19470 __tmp.put_u8(self.mission_type as u8);
19471 if matches!(version, MavlinkVersion::V2) {
19472 let len = __tmp.len();
19473 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19474 } else {
19475 __tmp.len()
19476 }
19477 }
19478}
19479#[doc = "id: 37"]
19480#[doc = "Request a partial list of mission items from the system/component. <https://mavlink.io/en/services/mission.html>. If start and end index are the same, just send one waypoint."]
19481#[derive(Debug, Clone, PartialEq)]
19482#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19483#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19484pub struct MISSION_REQUEST_PARTIAL_LIST_DATA {
19485 #[doc = "Start index"]
19486 pub start_index: i16,
19487 #[doc = "End index, -1 by default (-1: send list to end). Else a valid index of the list"]
19488 pub end_index: i16,
19489 #[doc = "System ID"]
19490 pub target_system: u8,
19491 #[doc = "Component ID"]
19492 pub target_component: u8,
19493 #[doc = "Mission type."]
19494 #[cfg_attr(feature = "serde", serde(default))]
19495 pub mission_type: MavMissionType,
19496}
19497impl MISSION_REQUEST_PARTIAL_LIST_DATA {
19498 pub const ENCODED_LEN: usize = 7usize;
19499 pub const DEFAULT: Self = Self {
19500 start_index: 0_i16,
19501 end_index: 0_i16,
19502 target_system: 0_u8,
19503 target_component: 0_u8,
19504 mission_type: MavMissionType::DEFAULT,
19505 };
19506 #[cfg(feature = "arbitrary")]
19507 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19508 use arbitrary::{Arbitrary, Unstructured};
19509 let mut buf = [0u8; 1024];
19510 rng.fill_bytes(&mut buf);
19511 let mut unstructured = Unstructured::new(&buf);
19512 Self::arbitrary(&mut unstructured).unwrap_or_default()
19513 }
19514}
19515impl Default for MISSION_REQUEST_PARTIAL_LIST_DATA {
19516 fn default() -> Self {
19517 Self::DEFAULT.clone()
19518 }
19519}
19520impl MessageData for MISSION_REQUEST_PARTIAL_LIST_DATA {
19521 type Message = MavMessage;
19522 const ID: u32 = 37u32;
19523 const NAME: &'static str = "MISSION_REQUEST_PARTIAL_LIST";
19524 const EXTRA_CRC: u8 = 212u8;
19525 const ENCODED_LEN: usize = 7usize;
19526 fn deser(
19527 _version: MavlinkVersion,
19528 __input: &[u8],
19529 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19530 let avail_len = __input.len();
19531 let mut payload_buf = [0; Self::ENCODED_LEN];
19532 let mut buf = if avail_len < Self::ENCODED_LEN {
19533 payload_buf[0..avail_len].copy_from_slice(__input);
19534 Bytes::new(&payload_buf)
19535 } else {
19536 Bytes::new(__input)
19537 };
19538 let mut __struct = Self::default();
19539 __struct.start_index = buf.get_i16_le();
19540 __struct.end_index = buf.get_i16_le();
19541 __struct.target_system = buf.get_u8();
19542 __struct.target_component = buf.get_u8();
19543 let tmp = buf.get_u8();
19544 __struct.mission_type =
19545 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19546 enum_type: "MavMissionType",
19547 value: tmp as u32,
19548 })?;
19549 Ok(__struct)
19550 }
19551 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19552 let mut __tmp = BytesMut::new(bytes);
19553 #[allow(clippy::absurd_extreme_comparisons)]
19554 #[allow(unused_comparisons)]
19555 if __tmp.remaining() < Self::ENCODED_LEN {
19556 panic!(
19557 "buffer is too small (need {} bytes, but got {})",
19558 Self::ENCODED_LEN,
19559 __tmp.remaining(),
19560 )
19561 }
19562 __tmp.put_i16_le(self.start_index);
19563 __tmp.put_i16_le(self.end_index);
19564 __tmp.put_u8(self.target_system);
19565 __tmp.put_u8(self.target_component);
19566 __tmp.put_u8(self.mission_type as u8);
19567 if matches!(version, MavlinkVersion::V2) {
19568 let len = __tmp.len();
19569 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19570 } else {
19571 __tmp.len()
19572 }
19573 }
19574}
19575#[deprecated = " See `MAV_CMD_DO_SET_MISSION_CURRENT` (Deprecated since 2022-08)"]
19576#[doc = "id: 41"]
19577#[doc = "Set the mission item with sequence number seq as the current item and emit MISSION_CURRENT (whether or not the mission number changed). If a mission is currently being executed, the system will continue to this new mission item on the shortest path, skipping any intermediate mission items. Note that mission jump repeat counters are not reset (see MAV_CMD_DO_JUMP param2). This message may trigger a mission state-machine change on some systems: for example from MISSION_STATE_NOT_STARTED or MISSION_STATE_PAUSED to MISSION_STATE_ACTIVE. If the system is in mission mode, on those systems this command might therefore start, restart or resume the mission. If the system is not in mission mode this message must not trigger a switch to mission mode."]
19578#[derive(Debug, Clone, PartialEq)]
19579#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19580#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19581pub struct MISSION_SET_CURRENT_DATA {
19582 #[doc = "Sequence"]
19583 pub seq: u16,
19584 #[doc = "System ID"]
19585 pub target_system: u8,
19586 #[doc = "Component ID"]
19587 pub target_component: u8,
19588}
19589impl MISSION_SET_CURRENT_DATA {
19590 pub const ENCODED_LEN: usize = 4usize;
19591 pub const DEFAULT: Self = Self {
19592 seq: 0_u16,
19593 target_system: 0_u8,
19594 target_component: 0_u8,
19595 };
19596 #[cfg(feature = "arbitrary")]
19597 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19598 use arbitrary::{Arbitrary, Unstructured};
19599 let mut buf = [0u8; 1024];
19600 rng.fill_bytes(&mut buf);
19601 let mut unstructured = Unstructured::new(&buf);
19602 Self::arbitrary(&mut unstructured).unwrap_or_default()
19603 }
19604}
19605impl Default for MISSION_SET_CURRENT_DATA {
19606 fn default() -> Self {
19607 Self::DEFAULT.clone()
19608 }
19609}
19610impl MessageData for MISSION_SET_CURRENT_DATA {
19611 type Message = MavMessage;
19612 const ID: u32 = 41u32;
19613 const NAME: &'static str = "MISSION_SET_CURRENT";
19614 const EXTRA_CRC: u8 = 28u8;
19615 const ENCODED_LEN: usize = 4usize;
19616 fn deser(
19617 _version: MavlinkVersion,
19618 __input: &[u8],
19619 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19620 let avail_len = __input.len();
19621 let mut payload_buf = [0; Self::ENCODED_LEN];
19622 let mut buf = if avail_len < Self::ENCODED_LEN {
19623 payload_buf[0..avail_len].copy_from_slice(__input);
19624 Bytes::new(&payload_buf)
19625 } else {
19626 Bytes::new(__input)
19627 };
19628 let mut __struct = Self::default();
19629 __struct.seq = buf.get_u16_le();
19630 __struct.target_system = buf.get_u8();
19631 __struct.target_component = buf.get_u8();
19632 Ok(__struct)
19633 }
19634 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19635 let mut __tmp = BytesMut::new(bytes);
19636 #[allow(clippy::absurd_extreme_comparisons)]
19637 #[allow(unused_comparisons)]
19638 if __tmp.remaining() < Self::ENCODED_LEN {
19639 panic!(
19640 "buffer is too small (need {} bytes, but got {})",
19641 Self::ENCODED_LEN,
19642 __tmp.remaining(),
19643 )
19644 }
19645 __tmp.put_u16_le(self.seq);
19646 __tmp.put_u8(self.target_system);
19647 __tmp.put_u8(self.target_component);
19648 if matches!(version, MavlinkVersion::V2) {
19649 let len = __tmp.len();
19650 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19651 } else {
19652 __tmp.len()
19653 }
19654 }
19655}
19656#[doc = "id: 38"]
19657#[doc = "This message is sent to the MAV to write a partial list. If start index == end index, only one item will be transmitted / updated. If the start index is NOT 0 and above the current list size, this request should be REJECTED!."]
19658#[derive(Debug, Clone, PartialEq)]
19659#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19660#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19661pub struct MISSION_WRITE_PARTIAL_LIST_DATA {
19662 #[doc = "Start index. Must be smaller / equal to the largest index of the current onboard list."]
19663 pub start_index: i16,
19664 #[doc = "End index, equal or greater than start index."]
19665 pub end_index: i16,
19666 #[doc = "System ID"]
19667 pub target_system: u8,
19668 #[doc = "Component ID"]
19669 pub target_component: u8,
19670 #[doc = "Mission type."]
19671 #[cfg_attr(feature = "serde", serde(default))]
19672 pub mission_type: MavMissionType,
19673}
19674impl MISSION_WRITE_PARTIAL_LIST_DATA {
19675 pub const ENCODED_LEN: usize = 7usize;
19676 pub const DEFAULT: Self = Self {
19677 start_index: 0_i16,
19678 end_index: 0_i16,
19679 target_system: 0_u8,
19680 target_component: 0_u8,
19681 mission_type: MavMissionType::DEFAULT,
19682 };
19683 #[cfg(feature = "arbitrary")]
19684 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19685 use arbitrary::{Arbitrary, Unstructured};
19686 let mut buf = [0u8; 1024];
19687 rng.fill_bytes(&mut buf);
19688 let mut unstructured = Unstructured::new(&buf);
19689 Self::arbitrary(&mut unstructured).unwrap_or_default()
19690 }
19691}
19692impl Default for MISSION_WRITE_PARTIAL_LIST_DATA {
19693 fn default() -> Self {
19694 Self::DEFAULT.clone()
19695 }
19696}
19697impl MessageData for MISSION_WRITE_PARTIAL_LIST_DATA {
19698 type Message = MavMessage;
19699 const ID: u32 = 38u32;
19700 const NAME: &'static str = "MISSION_WRITE_PARTIAL_LIST";
19701 const EXTRA_CRC: u8 = 9u8;
19702 const ENCODED_LEN: usize = 7usize;
19703 fn deser(
19704 _version: MavlinkVersion,
19705 __input: &[u8],
19706 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19707 let avail_len = __input.len();
19708 let mut payload_buf = [0; Self::ENCODED_LEN];
19709 let mut buf = if avail_len < Self::ENCODED_LEN {
19710 payload_buf[0..avail_len].copy_from_slice(__input);
19711 Bytes::new(&payload_buf)
19712 } else {
19713 Bytes::new(__input)
19714 };
19715 let mut __struct = Self::default();
19716 __struct.start_index = buf.get_i16_le();
19717 __struct.end_index = buf.get_i16_le();
19718 __struct.target_system = buf.get_u8();
19719 __struct.target_component = buf.get_u8();
19720 let tmp = buf.get_u8();
19721 __struct.mission_type =
19722 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19723 enum_type: "MavMissionType",
19724 value: tmp as u32,
19725 })?;
19726 Ok(__struct)
19727 }
19728 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19729 let mut __tmp = BytesMut::new(bytes);
19730 #[allow(clippy::absurd_extreme_comparisons)]
19731 #[allow(unused_comparisons)]
19732 if __tmp.remaining() < Self::ENCODED_LEN {
19733 panic!(
19734 "buffer is too small (need {} bytes, but got {})",
19735 Self::ENCODED_LEN,
19736 __tmp.remaining(),
19737 )
19738 }
19739 __tmp.put_i16_le(self.start_index);
19740 __tmp.put_i16_le(self.end_index);
19741 __tmp.put_u8(self.target_system);
19742 __tmp.put_u8(self.target_component);
19743 __tmp.put_u8(self.mission_type as u8);
19744 if matches!(version, MavlinkVersion::V2) {
19745 let len = __tmp.len();
19746 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19747 } else {
19748 __tmp.len()
19749 }
19750 }
19751}
19752#[deprecated = "This message is being superseded by MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
19753#[doc = "id: 265"]
19754#[doc = "Orientation of a mount."]
19755#[derive(Debug, Clone, PartialEq)]
19756#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19757#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19758pub struct MOUNT_ORIENTATION_DATA {
19759 #[doc = "Timestamp (time since system boot)."]
19760 pub time_boot_ms: u32,
19761 #[doc = "Roll in global frame (set to NaN for invalid)."]
19762 pub roll: f32,
19763 #[doc = "Pitch in global frame (set to NaN for invalid)."]
19764 pub pitch: f32,
19765 #[doc = "Yaw relative to vehicle (set to NaN for invalid)."]
19766 pub yaw: f32,
19767 #[doc = "Yaw in absolute frame relative to Earth's North, north is 0 (set to NaN for invalid)."]
19768 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19769 pub yaw_absolute: f32,
19770}
19771impl MOUNT_ORIENTATION_DATA {
19772 pub const ENCODED_LEN: usize = 20usize;
19773 pub const DEFAULT: Self = Self {
19774 time_boot_ms: 0_u32,
19775 roll: 0.0_f32,
19776 pitch: 0.0_f32,
19777 yaw: 0.0_f32,
19778 yaw_absolute: 0.0_f32,
19779 };
19780 #[cfg(feature = "arbitrary")]
19781 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19782 use arbitrary::{Arbitrary, Unstructured};
19783 let mut buf = [0u8; 1024];
19784 rng.fill_bytes(&mut buf);
19785 let mut unstructured = Unstructured::new(&buf);
19786 Self::arbitrary(&mut unstructured).unwrap_or_default()
19787 }
19788}
19789impl Default for MOUNT_ORIENTATION_DATA {
19790 fn default() -> Self {
19791 Self::DEFAULT.clone()
19792 }
19793}
19794impl MessageData for MOUNT_ORIENTATION_DATA {
19795 type Message = MavMessage;
19796 const ID: u32 = 265u32;
19797 const NAME: &'static str = "MOUNT_ORIENTATION";
19798 const EXTRA_CRC: u8 = 26u8;
19799 const ENCODED_LEN: usize = 20usize;
19800 fn deser(
19801 _version: MavlinkVersion,
19802 __input: &[u8],
19803 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19804 let avail_len = __input.len();
19805 let mut payload_buf = [0; Self::ENCODED_LEN];
19806 let mut buf = if avail_len < Self::ENCODED_LEN {
19807 payload_buf[0..avail_len].copy_from_slice(__input);
19808 Bytes::new(&payload_buf)
19809 } else {
19810 Bytes::new(__input)
19811 };
19812 let mut __struct = Self::default();
19813 __struct.time_boot_ms = buf.get_u32_le();
19814 __struct.roll = buf.get_f32_le();
19815 __struct.pitch = buf.get_f32_le();
19816 __struct.yaw = buf.get_f32_le();
19817 __struct.yaw_absolute = buf.get_f32_le();
19818 Ok(__struct)
19819 }
19820 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19821 let mut __tmp = BytesMut::new(bytes);
19822 #[allow(clippy::absurd_extreme_comparisons)]
19823 #[allow(unused_comparisons)]
19824 if __tmp.remaining() < Self::ENCODED_LEN {
19825 panic!(
19826 "buffer is too small (need {} bytes, but got {})",
19827 Self::ENCODED_LEN,
19828 __tmp.remaining(),
19829 )
19830 }
19831 __tmp.put_u32_le(self.time_boot_ms);
19832 __tmp.put_f32_le(self.roll);
19833 __tmp.put_f32_le(self.pitch);
19834 __tmp.put_f32_le(self.yaw);
19835 __tmp.put_f32_le(self.yaw_absolute);
19836 if matches!(version, MavlinkVersion::V2) {
19837 let len = __tmp.len();
19838 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19839 } else {
19840 __tmp.len()
19841 }
19842 }
19843}
19844#[doc = "id: 251"]
19845#[doc = "Send a key-value pair as float. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
19846#[derive(Debug, Clone, PartialEq)]
19847#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19848#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19849pub struct NAMED_VALUE_FLOAT_DATA {
19850 #[doc = "Timestamp (time since system boot)."]
19851 pub time_boot_ms: u32,
19852 #[doc = "Floating point value"]
19853 pub value: f32,
19854 #[doc = "Name of the debug variable"]
19855 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
19856 pub name: [u8; 10],
19857}
19858impl NAMED_VALUE_FLOAT_DATA {
19859 pub const ENCODED_LEN: usize = 18usize;
19860 pub const DEFAULT: Self = Self {
19861 time_boot_ms: 0_u32,
19862 value: 0.0_f32,
19863 name: [0_u8; 10usize],
19864 };
19865 #[cfg(feature = "arbitrary")]
19866 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19867 use arbitrary::{Arbitrary, Unstructured};
19868 let mut buf = [0u8; 1024];
19869 rng.fill_bytes(&mut buf);
19870 let mut unstructured = Unstructured::new(&buf);
19871 Self::arbitrary(&mut unstructured).unwrap_or_default()
19872 }
19873}
19874impl Default for NAMED_VALUE_FLOAT_DATA {
19875 fn default() -> Self {
19876 Self::DEFAULT.clone()
19877 }
19878}
19879impl MessageData for NAMED_VALUE_FLOAT_DATA {
19880 type Message = MavMessage;
19881 const ID: u32 = 251u32;
19882 const NAME: &'static str = "NAMED_VALUE_FLOAT";
19883 const EXTRA_CRC: u8 = 170u8;
19884 const ENCODED_LEN: usize = 18usize;
19885 fn deser(
19886 _version: MavlinkVersion,
19887 __input: &[u8],
19888 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19889 let avail_len = __input.len();
19890 let mut payload_buf = [0; Self::ENCODED_LEN];
19891 let mut buf = if avail_len < Self::ENCODED_LEN {
19892 payload_buf[0..avail_len].copy_from_slice(__input);
19893 Bytes::new(&payload_buf)
19894 } else {
19895 Bytes::new(__input)
19896 };
19897 let mut __struct = Self::default();
19898 __struct.time_boot_ms = buf.get_u32_le();
19899 __struct.value = buf.get_f32_le();
19900 for v in &mut __struct.name {
19901 let val = buf.get_u8();
19902 *v = val;
19903 }
19904 Ok(__struct)
19905 }
19906 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19907 let mut __tmp = BytesMut::new(bytes);
19908 #[allow(clippy::absurd_extreme_comparisons)]
19909 #[allow(unused_comparisons)]
19910 if __tmp.remaining() < Self::ENCODED_LEN {
19911 panic!(
19912 "buffer is too small (need {} bytes, but got {})",
19913 Self::ENCODED_LEN,
19914 __tmp.remaining(),
19915 )
19916 }
19917 __tmp.put_u32_le(self.time_boot_ms);
19918 __tmp.put_f32_le(self.value);
19919 for val in &self.name {
19920 __tmp.put_u8(*val);
19921 }
19922 if matches!(version, MavlinkVersion::V2) {
19923 let len = __tmp.len();
19924 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19925 } else {
19926 __tmp.len()
19927 }
19928 }
19929}
19930#[doc = "id: 252"]
19931#[doc = "Send a key-value pair as integer. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
19932#[derive(Debug, Clone, PartialEq)]
19933#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19934#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19935pub struct NAMED_VALUE_INT_DATA {
19936 #[doc = "Timestamp (time since system boot)."]
19937 pub time_boot_ms: u32,
19938 #[doc = "Signed integer value"]
19939 pub value: i32,
19940 #[doc = "Name of the debug variable"]
19941 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
19942 pub name: [u8; 10],
19943}
19944impl NAMED_VALUE_INT_DATA {
19945 pub const ENCODED_LEN: usize = 18usize;
19946 pub const DEFAULT: Self = Self {
19947 time_boot_ms: 0_u32,
19948 value: 0_i32,
19949 name: [0_u8; 10usize],
19950 };
19951 #[cfg(feature = "arbitrary")]
19952 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19953 use arbitrary::{Arbitrary, Unstructured};
19954 let mut buf = [0u8; 1024];
19955 rng.fill_bytes(&mut buf);
19956 let mut unstructured = Unstructured::new(&buf);
19957 Self::arbitrary(&mut unstructured).unwrap_or_default()
19958 }
19959}
19960impl Default for NAMED_VALUE_INT_DATA {
19961 fn default() -> Self {
19962 Self::DEFAULT.clone()
19963 }
19964}
19965impl MessageData for NAMED_VALUE_INT_DATA {
19966 type Message = MavMessage;
19967 const ID: u32 = 252u32;
19968 const NAME: &'static str = "NAMED_VALUE_INT";
19969 const EXTRA_CRC: u8 = 44u8;
19970 const ENCODED_LEN: usize = 18usize;
19971 fn deser(
19972 _version: MavlinkVersion,
19973 __input: &[u8],
19974 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19975 let avail_len = __input.len();
19976 let mut payload_buf = [0; Self::ENCODED_LEN];
19977 let mut buf = if avail_len < Self::ENCODED_LEN {
19978 payload_buf[0..avail_len].copy_from_slice(__input);
19979 Bytes::new(&payload_buf)
19980 } else {
19981 Bytes::new(__input)
19982 };
19983 let mut __struct = Self::default();
19984 __struct.time_boot_ms = buf.get_u32_le();
19985 __struct.value = buf.get_i32_le();
19986 for v in &mut __struct.name {
19987 let val = buf.get_u8();
19988 *v = val;
19989 }
19990 Ok(__struct)
19991 }
19992 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19993 let mut __tmp = BytesMut::new(bytes);
19994 #[allow(clippy::absurd_extreme_comparisons)]
19995 #[allow(unused_comparisons)]
19996 if __tmp.remaining() < Self::ENCODED_LEN {
19997 panic!(
19998 "buffer is too small (need {} bytes, but got {})",
19999 Self::ENCODED_LEN,
20000 __tmp.remaining(),
20001 )
20002 }
20003 __tmp.put_u32_le(self.time_boot_ms);
20004 __tmp.put_i32_le(self.value);
20005 for val in &self.name {
20006 __tmp.put_u8(*val);
20007 }
20008 if matches!(version, MavlinkVersion::V2) {
20009 let len = __tmp.len();
20010 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20011 } else {
20012 __tmp.len()
20013 }
20014 }
20015}
20016#[doc = "id: 62"]
20017#[doc = "The state of the navigation and position controller."]
20018#[derive(Debug, Clone, PartialEq)]
20019#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20020#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20021pub struct NAV_CONTROLLER_OUTPUT_DATA {
20022 #[doc = "Current desired roll"]
20023 pub nav_roll: f32,
20024 #[doc = "Current desired pitch"]
20025 pub nav_pitch: f32,
20026 #[doc = "Current altitude error"]
20027 pub alt_error: f32,
20028 #[doc = "Current airspeed error"]
20029 pub aspd_error: f32,
20030 #[doc = "Current crosstrack error on x-y plane"]
20031 pub xtrack_error: f32,
20032 #[doc = "Current desired heading"]
20033 pub nav_bearing: i16,
20034 #[doc = "Bearing to current waypoint/target"]
20035 pub target_bearing: i16,
20036 #[doc = "Distance to active waypoint"]
20037 pub wp_dist: u16,
20038}
20039impl NAV_CONTROLLER_OUTPUT_DATA {
20040 pub const ENCODED_LEN: usize = 26usize;
20041 pub const DEFAULT: Self = Self {
20042 nav_roll: 0.0_f32,
20043 nav_pitch: 0.0_f32,
20044 alt_error: 0.0_f32,
20045 aspd_error: 0.0_f32,
20046 xtrack_error: 0.0_f32,
20047 nav_bearing: 0_i16,
20048 target_bearing: 0_i16,
20049 wp_dist: 0_u16,
20050 };
20051 #[cfg(feature = "arbitrary")]
20052 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20053 use arbitrary::{Arbitrary, Unstructured};
20054 let mut buf = [0u8; 1024];
20055 rng.fill_bytes(&mut buf);
20056 let mut unstructured = Unstructured::new(&buf);
20057 Self::arbitrary(&mut unstructured).unwrap_or_default()
20058 }
20059}
20060impl Default for NAV_CONTROLLER_OUTPUT_DATA {
20061 fn default() -> Self {
20062 Self::DEFAULT.clone()
20063 }
20064}
20065impl MessageData for NAV_CONTROLLER_OUTPUT_DATA {
20066 type Message = MavMessage;
20067 const ID: u32 = 62u32;
20068 const NAME: &'static str = "NAV_CONTROLLER_OUTPUT";
20069 const EXTRA_CRC: u8 = 183u8;
20070 const ENCODED_LEN: usize = 26usize;
20071 fn deser(
20072 _version: MavlinkVersion,
20073 __input: &[u8],
20074 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20075 let avail_len = __input.len();
20076 let mut payload_buf = [0; Self::ENCODED_LEN];
20077 let mut buf = if avail_len < Self::ENCODED_LEN {
20078 payload_buf[0..avail_len].copy_from_slice(__input);
20079 Bytes::new(&payload_buf)
20080 } else {
20081 Bytes::new(__input)
20082 };
20083 let mut __struct = Self::default();
20084 __struct.nav_roll = buf.get_f32_le();
20085 __struct.nav_pitch = buf.get_f32_le();
20086 __struct.alt_error = buf.get_f32_le();
20087 __struct.aspd_error = buf.get_f32_le();
20088 __struct.xtrack_error = buf.get_f32_le();
20089 __struct.nav_bearing = buf.get_i16_le();
20090 __struct.target_bearing = buf.get_i16_le();
20091 __struct.wp_dist = buf.get_u16_le();
20092 Ok(__struct)
20093 }
20094 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20095 let mut __tmp = BytesMut::new(bytes);
20096 #[allow(clippy::absurd_extreme_comparisons)]
20097 #[allow(unused_comparisons)]
20098 if __tmp.remaining() < Self::ENCODED_LEN {
20099 panic!(
20100 "buffer is too small (need {} bytes, but got {})",
20101 Self::ENCODED_LEN,
20102 __tmp.remaining(),
20103 )
20104 }
20105 __tmp.put_f32_le(self.nav_roll);
20106 __tmp.put_f32_le(self.nav_pitch);
20107 __tmp.put_f32_le(self.alt_error);
20108 __tmp.put_f32_le(self.aspd_error);
20109 __tmp.put_f32_le(self.xtrack_error);
20110 __tmp.put_i16_le(self.nav_bearing);
20111 __tmp.put_i16_le(self.target_bearing);
20112 __tmp.put_u16_le(self.wp_dist);
20113 if matches!(version, MavlinkVersion::V2) {
20114 let len = __tmp.len();
20115 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20116 } else {
20117 __tmp.len()
20118 }
20119 }
20120}
20121#[doc = "id: 330"]
20122#[doc = "Obstacle distances in front of the sensor, starting from the left in increment degrees to the right."]
20123#[derive(Debug, Clone, PartialEq)]
20124#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20125#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20126pub struct OBSTACLE_DISTANCE_DATA {
20127 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
20128 pub time_usec: u64,
20129 #[doc = "Distance of obstacles around the vehicle with index 0 corresponding to north + angle_offset, unless otherwise specified in the frame. A value of 0 is valid and means that the obstacle is practically touching the sensor. A value of max_distance +1 means no obstacle is present. A value of UINT16_MAX for unknown/not used. In a array element, one unit corresponds to 1cm."]
20130 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20131 pub distances: [u16; 72],
20132 #[doc = "Minimum distance the sensor can measure."]
20133 pub min_distance: u16,
20134 #[doc = "Maximum distance the sensor can measure."]
20135 pub max_distance: u16,
20136 #[doc = "Class id of the distance sensor type."]
20137 pub sensor_type: MavDistanceSensor,
20138 #[doc = "Angular width in degrees of each array element. Increment direction is clockwise. This field is ignored if increment_f is non-zero."]
20139 pub increment: u8,
20140 #[doc = "Angular width in degrees of each array element as a float. If non-zero then this value is used instead of the uint8_t increment field. Positive is clockwise direction, negative is counter-clockwise."]
20141 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20142 pub increment_f: f32,
20143 #[doc = "Relative angle offset of the 0-index element in the distances array. Value of 0 corresponds to forward. Positive is clockwise direction, negative is counter-clockwise."]
20144 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20145 pub angle_offset: f32,
20146 #[doc = "Coordinate frame of reference for the yaw rotation and offset of the sensor data. Defaults to MAV_FRAME_GLOBAL, which is north aligned. For body-mounted sensors use MAV_FRAME_BODY_FRD, which is vehicle front aligned."]
20147 #[cfg_attr(feature = "serde", serde(default))]
20148 pub frame: MavFrame,
20149}
20150impl OBSTACLE_DISTANCE_DATA {
20151 pub const ENCODED_LEN: usize = 167usize;
20152 pub const DEFAULT: Self = Self {
20153 time_usec: 0_u64,
20154 distances: [0_u16; 72usize],
20155 min_distance: 0_u16,
20156 max_distance: 0_u16,
20157 sensor_type: MavDistanceSensor::DEFAULT,
20158 increment: 0_u8,
20159 increment_f: 0.0_f32,
20160 angle_offset: 0.0_f32,
20161 frame: MavFrame::DEFAULT,
20162 };
20163 #[cfg(feature = "arbitrary")]
20164 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20165 use arbitrary::{Arbitrary, Unstructured};
20166 let mut buf = [0u8; 1024];
20167 rng.fill_bytes(&mut buf);
20168 let mut unstructured = Unstructured::new(&buf);
20169 Self::arbitrary(&mut unstructured).unwrap_or_default()
20170 }
20171}
20172impl Default for OBSTACLE_DISTANCE_DATA {
20173 fn default() -> Self {
20174 Self::DEFAULT.clone()
20175 }
20176}
20177impl MessageData for OBSTACLE_DISTANCE_DATA {
20178 type Message = MavMessage;
20179 const ID: u32 = 330u32;
20180 const NAME: &'static str = "OBSTACLE_DISTANCE";
20181 const EXTRA_CRC: u8 = 23u8;
20182 const ENCODED_LEN: usize = 167usize;
20183 fn deser(
20184 _version: MavlinkVersion,
20185 __input: &[u8],
20186 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20187 let avail_len = __input.len();
20188 let mut payload_buf = [0; Self::ENCODED_LEN];
20189 let mut buf = if avail_len < Self::ENCODED_LEN {
20190 payload_buf[0..avail_len].copy_from_slice(__input);
20191 Bytes::new(&payload_buf)
20192 } else {
20193 Bytes::new(__input)
20194 };
20195 let mut __struct = Self::default();
20196 __struct.time_usec = buf.get_u64_le();
20197 for v in &mut __struct.distances {
20198 let val = buf.get_u16_le();
20199 *v = val;
20200 }
20201 __struct.min_distance = buf.get_u16_le();
20202 __struct.max_distance = buf.get_u16_le();
20203 let tmp = buf.get_u8();
20204 __struct.sensor_type =
20205 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20206 enum_type: "MavDistanceSensor",
20207 value: tmp as u32,
20208 })?;
20209 __struct.increment = buf.get_u8();
20210 __struct.increment_f = buf.get_f32_le();
20211 __struct.angle_offset = buf.get_f32_le();
20212 let tmp = buf.get_u8();
20213 __struct.frame =
20214 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20215 enum_type: "MavFrame",
20216 value: tmp as u32,
20217 })?;
20218 Ok(__struct)
20219 }
20220 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20221 let mut __tmp = BytesMut::new(bytes);
20222 #[allow(clippy::absurd_extreme_comparisons)]
20223 #[allow(unused_comparisons)]
20224 if __tmp.remaining() < Self::ENCODED_LEN {
20225 panic!(
20226 "buffer is too small (need {} bytes, but got {})",
20227 Self::ENCODED_LEN,
20228 __tmp.remaining(),
20229 )
20230 }
20231 __tmp.put_u64_le(self.time_usec);
20232 for val in &self.distances {
20233 __tmp.put_u16_le(*val);
20234 }
20235 __tmp.put_u16_le(self.min_distance);
20236 __tmp.put_u16_le(self.max_distance);
20237 __tmp.put_u8(self.sensor_type as u8);
20238 __tmp.put_u8(self.increment);
20239 __tmp.put_f32_le(self.increment_f);
20240 __tmp.put_f32_le(self.angle_offset);
20241 __tmp.put_u8(self.frame as u8);
20242 if matches!(version, MavlinkVersion::V2) {
20243 let len = __tmp.len();
20244 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20245 } else {
20246 __tmp.len()
20247 }
20248 }
20249}
20250#[doc = "id: 331"]
20251#[doc = "Odometry message to communicate odometry information with an external interface. Fits ROS REP 147 standard for aerial vehicles (<http://www.ros.org/reps/rep-0147.html>)."]
20252#[derive(Debug, Clone, PartialEq)]
20253#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20254#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20255pub struct ODOMETRY_DATA {
20256 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
20257 pub time_usec: u64,
20258 #[doc = "X Position"]
20259 pub x: f32,
20260 #[doc = "Y Position"]
20261 pub y: f32,
20262 #[doc = "Z Position"]
20263 pub z: f32,
20264 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation)"]
20265 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20266 pub q: [f32; 4],
20267 #[doc = "X linear speed"]
20268 pub vx: f32,
20269 #[doc = "Y linear speed"]
20270 pub vy: f32,
20271 #[doc = "Z linear speed"]
20272 pub vz: f32,
20273 #[doc = "Roll angular speed"]
20274 pub rollspeed: f32,
20275 #[doc = "Pitch angular speed"]
20276 pub pitchspeed: f32,
20277 #[doc = "Yaw angular speed"]
20278 pub yawspeed: f32,
20279 #[doc = "Row-major representation of a 6x6 pose cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
20280 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20281 pub pose_covariance: [f32; 21],
20282 #[doc = "Row-major representation of a 6x6 velocity cross-covariance matrix upper right triangle (states: vx, vy, vz, rollspeed, pitchspeed, yawspeed; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
20283 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20284 pub velocity_covariance: [f32; 21],
20285 #[doc = "Coordinate frame of reference for the pose data."]
20286 pub frame_id: MavFrame,
20287 #[doc = "Coordinate frame of reference for the velocity in free space (twist) data."]
20288 pub child_frame_id: MavFrame,
20289 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
20290 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20291 pub reset_counter: u8,
20292 #[doc = "Type of estimator that is providing the odometry."]
20293 #[cfg_attr(feature = "serde", serde(default))]
20294 pub estimator_type: MavEstimatorType,
20295 #[doc = "Optional odometry quality metric as a percentage. -1 = odometry has failed, 0 = unknown/unset quality, 1 = worst quality, 100 = best quality"]
20296 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20297 pub quality: i8,
20298}
20299impl ODOMETRY_DATA {
20300 pub const ENCODED_LEN: usize = 233usize;
20301 pub const DEFAULT: Self = Self {
20302 time_usec: 0_u64,
20303 x: 0.0_f32,
20304 y: 0.0_f32,
20305 z: 0.0_f32,
20306 q: [0.0_f32; 4usize],
20307 vx: 0.0_f32,
20308 vy: 0.0_f32,
20309 vz: 0.0_f32,
20310 rollspeed: 0.0_f32,
20311 pitchspeed: 0.0_f32,
20312 yawspeed: 0.0_f32,
20313 pose_covariance: [0.0_f32; 21usize],
20314 velocity_covariance: [0.0_f32; 21usize],
20315 frame_id: MavFrame::DEFAULT,
20316 child_frame_id: MavFrame::DEFAULT,
20317 reset_counter: 0_u8,
20318 estimator_type: MavEstimatorType::DEFAULT,
20319 quality: 0_i8,
20320 };
20321 #[cfg(feature = "arbitrary")]
20322 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20323 use arbitrary::{Arbitrary, Unstructured};
20324 let mut buf = [0u8; 1024];
20325 rng.fill_bytes(&mut buf);
20326 let mut unstructured = Unstructured::new(&buf);
20327 Self::arbitrary(&mut unstructured).unwrap_or_default()
20328 }
20329}
20330impl Default for ODOMETRY_DATA {
20331 fn default() -> Self {
20332 Self::DEFAULT.clone()
20333 }
20334}
20335impl MessageData for ODOMETRY_DATA {
20336 type Message = MavMessage;
20337 const ID: u32 = 331u32;
20338 const NAME: &'static str = "ODOMETRY";
20339 const EXTRA_CRC: u8 = 91u8;
20340 const ENCODED_LEN: usize = 233usize;
20341 fn deser(
20342 _version: MavlinkVersion,
20343 __input: &[u8],
20344 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20345 let avail_len = __input.len();
20346 let mut payload_buf = [0; Self::ENCODED_LEN];
20347 let mut buf = if avail_len < Self::ENCODED_LEN {
20348 payload_buf[0..avail_len].copy_from_slice(__input);
20349 Bytes::new(&payload_buf)
20350 } else {
20351 Bytes::new(__input)
20352 };
20353 let mut __struct = Self::default();
20354 __struct.time_usec = buf.get_u64_le();
20355 __struct.x = buf.get_f32_le();
20356 __struct.y = buf.get_f32_le();
20357 __struct.z = buf.get_f32_le();
20358 for v in &mut __struct.q {
20359 let val = buf.get_f32_le();
20360 *v = val;
20361 }
20362 __struct.vx = buf.get_f32_le();
20363 __struct.vy = buf.get_f32_le();
20364 __struct.vz = buf.get_f32_le();
20365 __struct.rollspeed = buf.get_f32_le();
20366 __struct.pitchspeed = buf.get_f32_le();
20367 __struct.yawspeed = buf.get_f32_le();
20368 for v in &mut __struct.pose_covariance {
20369 let val = buf.get_f32_le();
20370 *v = val;
20371 }
20372 for v in &mut __struct.velocity_covariance {
20373 let val = buf.get_f32_le();
20374 *v = val;
20375 }
20376 let tmp = buf.get_u8();
20377 __struct.frame_id =
20378 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20379 enum_type: "MavFrame",
20380 value: tmp as u32,
20381 })?;
20382 let tmp = buf.get_u8();
20383 __struct.child_frame_id =
20384 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20385 enum_type: "MavFrame",
20386 value: tmp as u32,
20387 })?;
20388 __struct.reset_counter = buf.get_u8();
20389 let tmp = buf.get_u8();
20390 __struct.estimator_type =
20391 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20392 enum_type: "MavEstimatorType",
20393 value: tmp as u32,
20394 })?;
20395 __struct.quality = buf.get_i8();
20396 Ok(__struct)
20397 }
20398 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20399 let mut __tmp = BytesMut::new(bytes);
20400 #[allow(clippy::absurd_extreme_comparisons)]
20401 #[allow(unused_comparisons)]
20402 if __tmp.remaining() < Self::ENCODED_LEN {
20403 panic!(
20404 "buffer is too small (need {} bytes, but got {})",
20405 Self::ENCODED_LEN,
20406 __tmp.remaining(),
20407 )
20408 }
20409 __tmp.put_u64_le(self.time_usec);
20410 __tmp.put_f32_le(self.x);
20411 __tmp.put_f32_le(self.y);
20412 __tmp.put_f32_le(self.z);
20413 for val in &self.q {
20414 __tmp.put_f32_le(*val);
20415 }
20416 __tmp.put_f32_le(self.vx);
20417 __tmp.put_f32_le(self.vy);
20418 __tmp.put_f32_le(self.vz);
20419 __tmp.put_f32_le(self.rollspeed);
20420 __tmp.put_f32_le(self.pitchspeed);
20421 __tmp.put_f32_le(self.yawspeed);
20422 for val in &self.pose_covariance {
20423 __tmp.put_f32_le(*val);
20424 }
20425 for val in &self.velocity_covariance {
20426 __tmp.put_f32_le(*val);
20427 }
20428 __tmp.put_u8(self.frame_id as u8);
20429 __tmp.put_u8(self.child_frame_id as u8);
20430 __tmp.put_u8(self.reset_counter);
20431 __tmp.put_u8(self.estimator_type as u8);
20432 __tmp.put_i8(self.quality);
20433 if matches!(version, MavlinkVersion::V2) {
20434 let len = __tmp.len();
20435 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20436 } else {
20437 __tmp.len()
20438 }
20439 }
20440}
20441#[doc = "id: 390"]
20442#[doc = "Hardware status sent by an onboard computer."]
20443#[derive(Debug, Clone, PartialEq)]
20444#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20445#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20446pub struct ONBOARD_COMPUTER_STATUS_DATA {
20447 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
20448 pub time_usec: u64,
20449 #[doc = "Time since system boot."]
20450 pub uptime: u32,
20451 #[doc = "Amount of used RAM on the component system. A value of UINT32_MAX implies the field is unused."]
20452 pub ram_usage: u32,
20453 #[doc = "Total amount of RAM on the component system. A value of UINT32_MAX implies the field is unused."]
20454 pub ram_total: u32,
20455 #[doc = "Storage type: 0: HDD, 1: SSD, 2: EMMC, 3: SD card (non-removable), 4: SD card (removable). A value of UINT32_MAX implies the field is unused."]
20456 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20457 pub storage_type: [u32; 4],
20458 #[doc = "Amount of used storage space on the component system. A value of UINT32_MAX implies the field is unused."]
20459 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20460 pub storage_usage: [u32; 4],
20461 #[doc = "Total amount of storage space on the component system. A value of UINT32_MAX implies the field is unused."]
20462 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20463 pub storage_total: [u32; 4],
20464 #[doc = "Link type: 0-9: UART, 10-19: Wired network, 20-29: Wifi, 30-39: Point-to-point proprietary, 40-49: Mesh proprietary"]
20465 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20466 pub link_type: [u32; 6],
20467 #[doc = "Network traffic from the component system. A value of UINT32_MAX implies the field is unused."]
20468 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20469 pub link_tx_rate: [u32; 6],
20470 #[doc = "Network traffic to the component system. A value of UINT32_MAX implies the field is unused."]
20471 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20472 pub link_rx_rate: [u32; 6],
20473 #[doc = "Network capacity from the component system. A value of UINT32_MAX implies the field is unused."]
20474 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20475 pub link_tx_max: [u32; 6],
20476 #[doc = "Network capacity to the component system. A value of UINT32_MAX implies the field is unused."]
20477 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20478 pub link_rx_max: [u32; 6],
20479 #[doc = "Fan speeds. A value of INT16_MAX implies the field is unused."]
20480 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20481 pub fan_speed: [i16; 4],
20482 #[doc = "Type of the onboard computer: 0: Mission computer primary, 1: Mission computer backup 1, 2: Mission computer backup 2, 3: Compute node, 4-5: Compute spares, 6-9: Payload computers."]
20483 pub mavtype: u8,
20484 #[doc = "CPU usage on the component in percent (100 - idle). A value of UINT8_MAX implies the field is unused."]
20485 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20486 pub cpu_cores: [u8; 8],
20487 #[doc = "Combined CPU usage as the last 10 slices of 100 MS (a histogram). This allows to identify spikes in load that max out the system, but only for a short amount of time. A value of UINT8_MAX implies the field is unused."]
20488 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20489 pub cpu_combined: [u8; 10],
20490 #[doc = "GPU usage on the component in percent (100 - idle). A value of UINT8_MAX implies the field is unused."]
20491 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20492 pub gpu_cores: [u8; 4],
20493 #[doc = "Combined GPU usage as the last 10 slices of 100 MS (a histogram). This allows to identify spikes in load that max out the system, but only for a short amount of time. A value of UINT8_MAX implies the field is unused."]
20494 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20495 pub gpu_combined: [u8; 10],
20496 #[doc = "Temperature of the board. A value of INT8_MAX implies the field is unused."]
20497 pub temperature_board: i8,
20498 #[doc = "Temperature of the CPU core. A value of INT8_MAX implies the field is unused."]
20499 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20500 pub temperature_core: [i8; 8],
20501}
20502impl ONBOARD_COMPUTER_STATUS_DATA {
20503 pub const ENCODED_LEN: usize = 238usize;
20504 pub const DEFAULT: Self = Self {
20505 time_usec: 0_u64,
20506 uptime: 0_u32,
20507 ram_usage: 0_u32,
20508 ram_total: 0_u32,
20509 storage_type: [0_u32; 4usize],
20510 storage_usage: [0_u32; 4usize],
20511 storage_total: [0_u32; 4usize],
20512 link_type: [0_u32; 6usize],
20513 link_tx_rate: [0_u32; 6usize],
20514 link_rx_rate: [0_u32; 6usize],
20515 link_tx_max: [0_u32; 6usize],
20516 link_rx_max: [0_u32; 6usize],
20517 fan_speed: [0_i16; 4usize],
20518 mavtype: 0_u8,
20519 cpu_cores: [0_u8; 8usize],
20520 cpu_combined: [0_u8; 10usize],
20521 gpu_cores: [0_u8; 4usize],
20522 gpu_combined: [0_u8; 10usize],
20523 temperature_board: 0_i8,
20524 temperature_core: [0_i8; 8usize],
20525 };
20526 #[cfg(feature = "arbitrary")]
20527 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20528 use arbitrary::{Arbitrary, Unstructured};
20529 let mut buf = [0u8; 1024];
20530 rng.fill_bytes(&mut buf);
20531 let mut unstructured = Unstructured::new(&buf);
20532 Self::arbitrary(&mut unstructured).unwrap_or_default()
20533 }
20534}
20535impl Default for ONBOARD_COMPUTER_STATUS_DATA {
20536 fn default() -> Self {
20537 Self::DEFAULT.clone()
20538 }
20539}
20540impl MessageData for ONBOARD_COMPUTER_STATUS_DATA {
20541 type Message = MavMessage;
20542 const ID: u32 = 390u32;
20543 const NAME: &'static str = "ONBOARD_COMPUTER_STATUS";
20544 const EXTRA_CRC: u8 = 156u8;
20545 const ENCODED_LEN: usize = 238usize;
20546 fn deser(
20547 _version: MavlinkVersion,
20548 __input: &[u8],
20549 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20550 let avail_len = __input.len();
20551 let mut payload_buf = [0; Self::ENCODED_LEN];
20552 let mut buf = if avail_len < Self::ENCODED_LEN {
20553 payload_buf[0..avail_len].copy_from_slice(__input);
20554 Bytes::new(&payload_buf)
20555 } else {
20556 Bytes::new(__input)
20557 };
20558 let mut __struct = Self::default();
20559 __struct.time_usec = buf.get_u64_le();
20560 __struct.uptime = buf.get_u32_le();
20561 __struct.ram_usage = buf.get_u32_le();
20562 __struct.ram_total = buf.get_u32_le();
20563 for v in &mut __struct.storage_type {
20564 let val = buf.get_u32_le();
20565 *v = val;
20566 }
20567 for v in &mut __struct.storage_usage {
20568 let val = buf.get_u32_le();
20569 *v = val;
20570 }
20571 for v in &mut __struct.storage_total {
20572 let val = buf.get_u32_le();
20573 *v = val;
20574 }
20575 for v in &mut __struct.link_type {
20576 let val = buf.get_u32_le();
20577 *v = val;
20578 }
20579 for v in &mut __struct.link_tx_rate {
20580 let val = buf.get_u32_le();
20581 *v = val;
20582 }
20583 for v in &mut __struct.link_rx_rate {
20584 let val = buf.get_u32_le();
20585 *v = val;
20586 }
20587 for v in &mut __struct.link_tx_max {
20588 let val = buf.get_u32_le();
20589 *v = val;
20590 }
20591 for v in &mut __struct.link_rx_max {
20592 let val = buf.get_u32_le();
20593 *v = val;
20594 }
20595 for v in &mut __struct.fan_speed {
20596 let val = buf.get_i16_le();
20597 *v = val;
20598 }
20599 __struct.mavtype = buf.get_u8();
20600 for v in &mut __struct.cpu_cores {
20601 let val = buf.get_u8();
20602 *v = val;
20603 }
20604 for v in &mut __struct.cpu_combined {
20605 let val = buf.get_u8();
20606 *v = val;
20607 }
20608 for v in &mut __struct.gpu_cores {
20609 let val = buf.get_u8();
20610 *v = val;
20611 }
20612 for v in &mut __struct.gpu_combined {
20613 let val = buf.get_u8();
20614 *v = val;
20615 }
20616 __struct.temperature_board = buf.get_i8();
20617 for v in &mut __struct.temperature_core {
20618 let val = buf.get_i8();
20619 *v = val;
20620 }
20621 Ok(__struct)
20622 }
20623 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20624 let mut __tmp = BytesMut::new(bytes);
20625 #[allow(clippy::absurd_extreme_comparisons)]
20626 #[allow(unused_comparisons)]
20627 if __tmp.remaining() < Self::ENCODED_LEN {
20628 panic!(
20629 "buffer is too small (need {} bytes, but got {})",
20630 Self::ENCODED_LEN,
20631 __tmp.remaining(),
20632 )
20633 }
20634 __tmp.put_u64_le(self.time_usec);
20635 __tmp.put_u32_le(self.uptime);
20636 __tmp.put_u32_le(self.ram_usage);
20637 __tmp.put_u32_le(self.ram_total);
20638 for val in &self.storage_type {
20639 __tmp.put_u32_le(*val);
20640 }
20641 for val in &self.storage_usage {
20642 __tmp.put_u32_le(*val);
20643 }
20644 for val in &self.storage_total {
20645 __tmp.put_u32_le(*val);
20646 }
20647 for val in &self.link_type {
20648 __tmp.put_u32_le(*val);
20649 }
20650 for val in &self.link_tx_rate {
20651 __tmp.put_u32_le(*val);
20652 }
20653 for val in &self.link_rx_rate {
20654 __tmp.put_u32_le(*val);
20655 }
20656 for val in &self.link_tx_max {
20657 __tmp.put_u32_le(*val);
20658 }
20659 for val in &self.link_rx_max {
20660 __tmp.put_u32_le(*val);
20661 }
20662 for val in &self.fan_speed {
20663 __tmp.put_i16_le(*val);
20664 }
20665 __tmp.put_u8(self.mavtype);
20666 for val in &self.cpu_cores {
20667 __tmp.put_u8(*val);
20668 }
20669 for val in &self.cpu_combined {
20670 __tmp.put_u8(*val);
20671 }
20672 for val in &self.gpu_cores {
20673 __tmp.put_u8(*val);
20674 }
20675 for val in &self.gpu_combined {
20676 __tmp.put_u8(*val);
20677 }
20678 __tmp.put_i8(self.temperature_board);
20679 for val in &self.temperature_core {
20680 __tmp.put_i8(*val);
20681 }
20682 if matches!(version, MavlinkVersion::V2) {
20683 let len = __tmp.len();
20684 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20685 } else {
20686 __tmp.len()
20687 }
20688 }
20689}
20690#[doc = "id: 12918"]
20691#[doc = "Transmitter (remote ID system) is enabled and ready to start sending location and other required information. This is streamed by transmitter. A flight controller uses it as a condition to arm."]
20692#[derive(Debug, Clone, PartialEq)]
20693#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20694#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20695pub struct OPEN_DRONE_ID_ARM_STATUS_DATA {
20696 #[doc = "Status level indicating if arming is allowed."]
20697 pub status: MavOdidArmStatus,
20698 #[doc = "Text error message, should be empty if status is good to arm. Fill with nulls in unused portion."]
20699 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20700 pub error: [u8; 50],
20701}
20702impl OPEN_DRONE_ID_ARM_STATUS_DATA {
20703 pub const ENCODED_LEN: usize = 51usize;
20704 pub const DEFAULT: Self = Self {
20705 status: MavOdidArmStatus::DEFAULT,
20706 error: [0_u8; 50usize],
20707 };
20708 #[cfg(feature = "arbitrary")]
20709 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20710 use arbitrary::{Arbitrary, Unstructured};
20711 let mut buf = [0u8; 1024];
20712 rng.fill_bytes(&mut buf);
20713 let mut unstructured = Unstructured::new(&buf);
20714 Self::arbitrary(&mut unstructured).unwrap_or_default()
20715 }
20716}
20717impl Default for OPEN_DRONE_ID_ARM_STATUS_DATA {
20718 fn default() -> Self {
20719 Self::DEFAULT.clone()
20720 }
20721}
20722impl MessageData for OPEN_DRONE_ID_ARM_STATUS_DATA {
20723 type Message = MavMessage;
20724 const ID: u32 = 12918u32;
20725 const NAME: &'static str = "OPEN_DRONE_ID_ARM_STATUS";
20726 const EXTRA_CRC: u8 = 139u8;
20727 const ENCODED_LEN: usize = 51usize;
20728 fn deser(
20729 _version: MavlinkVersion,
20730 __input: &[u8],
20731 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20732 let avail_len = __input.len();
20733 let mut payload_buf = [0; Self::ENCODED_LEN];
20734 let mut buf = if avail_len < Self::ENCODED_LEN {
20735 payload_buf[0..avail_len].copy_from_slice(__input);
20736 Bytes::new(&payload_buf)
20737 } else {
20738 Bytes::new(__input)
20739 };
20740 let mut __struct = Self::default();
20741 let tmp = buf.get_u8();
20742 __struct.status =
20743 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20744 enum_type: "MavOdidArmStatus",
20745 value: tmp as u32,
20746 })?;
20747 for v in &mut __struct.error {
20748 let val = buf.get_u8();
20749 *v = val;
20750 }
20751 Ok(__struct)
20752 }
20753 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20754 let mut __tmp = BytesMut::new(bytes);
20755 #[allow(clippy::absurd_extreme_comparisons)]
20756 #[allow(unused_comparisons)]
20757 if __tmp.remaining() < Self::ENCODED_LEN {
20758 panic!(
20759 "buffer is too small (need {} bytes, but got {})",
20760 Self::ENCODED_LEN,
20761 __tmp.remaining(),
20762 )
20763 }
20764 __tmp.put_u8(self.status as u8);
20765 for val in &self.error {
20766 __tmp.put_u8(*val);
20767 }
20768 if matches!(version, MavlinkVersion::V2) {
20769 let len = __tmp.len();
20770 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20771 } else {
20772 __tmp.len()
20773 }
20774 }
20775}
20776#[doc = "id: 12902"]
20777#[doc = "Data for filling the OpenDroneID Authentication message. The Authentication Message defines a field that can provide a means of authenticity for the identity of the UAS (Unmanned Aircraft System). The Authentication message can have two different formats. For data page 0, the fields PageCount, Length and TimeStamp are present and AuthData is only 17 bytes. For data page 1 through 15, PageCount, Length and TimeStamp are not present and the size of AuthData is 23 bytes."]
20778#[derive(Debug, Clone, PartialEq)]
20779#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20780#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20781pub struct OPEN_DRONE_ID_AUTHENTICATION_DATA {
20782 #[doc = "This field is only present for page 0. 32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019."]
20783 pub timestamp: u32,
20784 #[doc = "System ID (0 for broadcast)."]
20785 pub target_system: u8,
20786 #[doc = "Component ID (0 for broadcast)."]
20787 pub target_component: u8,
20788 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
20789 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20790 pub id_or_mac: [u8; 20],
20791 #[doc = "Indicates the type of authentication."]
20792 pub authentication_type: MavOdidAuthType,
20793 #[doc = "Allowed range is 0 - 15."]
20794 pub data_page: u8,
20795 #[doc = "This field is only present for page 0. Allowed range is 0 - 15. See the description of struct ODID_Auth_data at <https://github.com/opendroneid/opendroneid-core-c/blob/master/libopendroneid/opendroneid.h>."]
20796 pub last_page_index: u8,
20797 #[doc = "This field is only present for page 0. Total bytes of authentication_data from all data pages. See the description of struct ODID_Auth_data at <https://github.com/opendroneid/opendroneid-core-c/blob/master/libopendroneid/opendroneid.h>."]
20798 pub length: u8,
20799 #[doc = "Opaque authentication data. For page 0, the size is only 17 bytes. For other pages, the size is 23 bytes. Shall be filled with nulls in the unused portion of the field."]
20800 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20801 pub authentication_data: [u8; 23],
20802}
20803impl OPEN_DRONE_ID_AUTHENTICATION_DATA {
20804 pub const ENCODED_LEN: usize = 53usize;
20805 pub const DEFAULT: Self = Self {
20806 timestamp: 0_u32,
20807 target_system: 0_u8,
20808 target_component: 0_u8,
20809 id_or_mac: [0_u8; 20usize],
20810 authentication_type: MavOdidAuthType::DEFAULT,
20811 data_page: 0_u8,
20812 last_page_index: 0_u8,
20813 length: 0_u8,
20814 authentication_data: [0_u8; 23usize],
20815 };
20816 #[cfg(feature = "arbitrary")]
20817 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20818 use arbitrary::{Arbitrary, Unstructured};
20819 let mut buf = [0u8; 1024];
20820 rng.fill_bytes(&mut buf);
20821 let mut unstructured = Unstructured::new(&buf);
20822 Self::arbitrary(&mut unstructured).unwrap_or_default()
20823 }
20824}
20825impl Default for OPEN_DRONE_ID_AUTHENTICATION_DATA {
20826 fn default() -> Self {
20827 Self::DEFAULT.clone()
20828 }
20829}
20830impl MessageData for OPEN_DRONE_ID_AUTHENTICATION_DATA {
20831 type Message = MavMessage;
20832 const ID: u32 = 12902u32;
20833 const NAME: &'static str = "OPEN_DRONE_ID_AUTHENTICATION";
20834 const EXTRA_CRC: u8 = 140u8;
20835 const ENCODED_LEN: usize = 53usize;
20836 fn deser(
20837 _version: MavlinkVersion,
20838 __input: &[u8],
20839 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20840 let avail_len = __input.len();
20841 let mut payload_buf = [0; Self::ENCODED_LEN];
20842 let mut buf = if avail_len < Self::ENCODED_LEN {
20843 payload_buf[0..avail_len].copy_from_slice(__input);
20844 Bytes::new(&payload_buf)
20845 } else {
20846 Bytes::new(__input)
20847 };
20848 let mut __struct = Self::default();
20849 __struct.timestamp = buf.get_u32_le();
20850 __struct.target_system = buf.get_u8();
20851 __struct.target_component = buf.get_u8();
20852 for v in &mut __struct.id_or_mac {
20853 let val = buf.get_u8();
20854 *v = val;
20855 }
20856 let tmp = buf.get_u8();
20857 __struct.authentication_type =
20858 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20859 enum_type: "MavOdidAuthType",
20860 value: tmp as u32,
20861 })?;
20862 __struct.data_page = buf.get_u8();
20863 __struct.last_page_index = buf.get_u8();
20864 __struct.length = buf.get_u8();
20865 for v in &mut __struct.authentication_data {
20866 let val = buf.get_u8();
20867 *v = val;
20868 }
20869 Ok(__struct)
20870 }
20871 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20872 let mut __tmp = BytesMut::new(bytes);
20873 #[allow(clippy::absurd_extreme_comparisons)]
20874 #[allow(unused_comparisons)]
20875 if __tmp.remaining() < Self::ENCODED_LEN {
20876 panic!(
20877 "buffer is too small (need {} bytes, but got {})",
20878 Self::ENCODED_LEN,
20879 __tmp.remaining(),
20880 )
20881 }
20882 __tmp.put_u32_le(self.timestamp);
20883 __tmp.put_u8(self.target_system);
20884 __tmp.put_u8(self.target_component);
20885 for val in &self.id_or_mac {
20886 __tmp.put_u8(*val);
20887 }
20888 __tmp.put_u8(self.authentication_type as u8);
20889 __tmp.put_u8(self.data_page);
20890 __tmp.put_u8(self.last_page_index);
20891 __tmp.put_u8(self.length);
20892 for val in &self.authentication_data {
20893 __tmp.put_u8(*val);
20894 }
20895 if matches!(version, MavlinkVersion::V2) {
20896 let len = __tmp.len();
20897 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20898 } else {
20899 __tmp.len()
20900 }
20901 }
20902}
20903#[doc = "id: 12900"]
20904#[doc = "Data for filling the OpenDroneID Basic ID message. This and the below messages are primarily meant for feeding data to/from an OpenDroneID implementation. E.g. <https://github.com/opendroneid/opendroneid-core-c>. These messages are compatible with the ASTM F3411 Remote ID standard and the ASD-STAN prEN 4709-002 Direct Remote ID standard. Additional information and usage of these messages is documented at <https://mavlink.io/en/services/opendroneid.html>."]
20905#[derive(Debug, Clone, PartialEq)]
20906#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20907#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20908pub struct OPEN_DRONE_ID_BASIC_ID_DATA {
20909 #[doc = "System ID (0 for broadcast)."]
20910 pub target_system: u8,
20911 #[doc = "Component ID (0 for broadcast)."]
20912 pub target_component: u8,
20913 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
20914 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20915 pub id_or_mac: [u8; 20],
20916 #[doc = "Indicates the format for the uas_id field of this message."]
20917 pub id_type: MavOdidIdType,
20918 #[doc = "Indicates the type of UA (Unmanned Aircraft)."]
20919 pub ua_type: MavOdidUaType,
20920 #[doc = "UAS (Unmanned Aircraft System) ID following the format specified by id_type. Shall be filled with nulls in the unused portion of the field."]
20921 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20922 pub uas_id: [u8; 20],
20923}
20924impl OPEN_DRONE_ID_BASIC_ID_DATA {
20925 pub const ENCODED_LEN: usize = 44usize;
20926 pub const DEFAULT: Self = Self {
20927 target_system: 0_u8,
20928 target_component: 0_u8,
20929 id_or_mac: [0_u8; 20usize],
20930 id_type: MavOdidIdType::DEFAULT,
20931 ua_type: MavOdidUaType::DEFAULT,
20932 uas_id: [0_u8; 20usize],
20933 };
20934 #[cfg(feature = "arbitrary")]
20935 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20936 use arbitrary::{Arbitrary, Unstructured};
20937 let mut buf = [0u8; 1024];
20938 rng.fill_bytes(&mut buf);
20939 let mut unstructured = Unstructured::new(&buf);
20940 Self::arbitrary(&mut unstructured).unwrap_or_default()
20941 }
20942}
20943impl Default for OPEN_DRONE_ID_BASIC_ID_DATA {
20944 fn default() -> Self {
20945 Self::DEFAULT.clone()
20946 }
20947}
20948impl MessageData for OPEN_DRONE_ID_BASIC_ID_DATA {
20949 type Message = MavMessage;
20950 const ID: u32 = 12900u32;
20951 const NAME: &'static str = "OPEN_DRONE_ID_BASIC_ID";
20952 const EXTRA_CRC: u8 = 114u8;
20953 const ENCODED_LEN: usize = 44usize;
20954 fn deser(
20955 _version: MavlinkVersion,
20956 __input: &[u8],
20957 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20958 let avail_len = __input.len();
20959 let mut payload_buf = [0; Self::ENCODED_LEN];
20960 let mut buf = if avail_len < Self::ENCODED_LEN {
20961 payload_buf[0..avail_len].copy_from_slice(__input);
20962 Bytes::new(&payload_buf)
20963 } else {
20964 Bytes::new(__input)
20965 };
20966 let mut __struct = Self::default();
20967 __struct.target_system = buf.get_u8();
20968 __struct.target_component = buf.get_u8();
20969 for v in &mut __struct.id_or_mac {
20970 let val = buf.get_u8();
20971 *v = val;
20972 }
20973 let tmp = buf.get_u8();
20974 __struct.id_type =
20975 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20976 enum_type: "MavOdidIdType",
20977 value: tmp as u32,
20978 })?;
20979 let tmp = buf.get_u8();
20980 __struct.ua_type =
20981 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20982 enum_type: "MavOdidUaType",
20983 value: tmp as u32,
20984 })?;
20985 for v in &mut __struct.uas_id {
20986 let val = buf.get_u8();
20987 *v = val;
20988 }
20989 Ok(__struct)
20990 }
20991 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20992 let mut __tmp = BytesMut::new(bytes);
20993 #[allow(clippy::absurd_extreme_comparisons)]
20994 #[allow(unused_comparisons)]
20995 if __tmp.remaining() < Self::ENCODED_LEN {
20996 panic!(
20997 "buffer is too small (need {} bytes, but got {})",
20998 Self::ENCODED_LEN,
20999 __tmp.remaining(),
21000 )
21001 }
21002 __tmp.put_u8(self.target_system);
21003 __tmp.put_u8(self.target_component);
21004 for val in &self.id_or_mac {
21005 __tmp.put_u8(*val);
21006 }
21007 __tmp.put_u8(self.id_type as u8);
21008 __tmp.put_u8(self.ua_type as u8);
21009 for val in &self.uas_id {
21010 __tmp.put_u8(*val);
21011 }
21012 if matches!(version, MavlinkVersion::V2) {
21013 let len = __tmp.len();
21014 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21015 } else {
21016 __tmp.len()
21017 }
21018 }
21019}
21020#[doc = "id: 12901"]
21021#[doc = "Data for filling the OpenDroneID Location message. The float data types are 32-bit IEEE 754. The Location message provides the location, altitude, direction and speed of the aircraft."]
21022#[derive(Debug, Clone, PartialEq)]
21023#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21024#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21025pub struct OPEN_DRONE_ID_LOCATION_DATA {
21026 #[doc = "Current latitude of the unmanned aircraft. If unknown: 0 (both Lat/Lon)."]
21027 pub latitude: i32,
21028 #[doc = "Current longitude of the unmanned aircraft. If unknown: 0 (both Lat/Lon)."]
21029 pub longitude: i32,
21030 #[doc = "The altitude calculated from the barometric pressue. Reference is against 29.92inHg or 1013.2mb. If unknown: -1000 m."]
21031 pub altitude_barometric: f32,
21032 #[doc = "The geodetic altitude as defined by WGS84. If unknown: -1000 m."]
21033 pub altitude_geodetic: f32,
21034 #[doc = "The current height of the unmanned aircraft above the take-off location or the ground as indicated by height_reference. If unknown: -1000 m."]
21035 pub height: f32,
21036 #[doc = "Seconds after the full hour with reference to UTC time. Typically the GPS outputs a time-of-week value in milliseconds. First convert that to UTC and then convert for this field using ((float) (time_week_ms % (60*60*1000))) / 1000. If unknown: 0xFFFF."]
21037 pub timestamp: f32,
21038 #[doc = "Direction over ground (not heading, but direction of movement) measured clockwise from true North: 0 - 35999 centi-degrees. If unknown: 36100 centi-degrees."]
21039 pub direction: u16,
21040 #[doc = "Ground speed. Positive only. If unknown: 25500 cm/s. If speed is larger than 25425 cm/s, use 25425 cm/s."]
21041 pub speed_horizontal: u16,
21042 #[doc = "The vertical speed. Up is positive. If unknown: 6300 cm/s. If speed is larger than 6200 cm/s, use 6200 cm/s. If lower than -6200 cm/s, use -6200 cm/s."]
21043 pub speed_vertical: i16,
21044 #[doc = "System ID (0 for broadcast)."]
21045 pub target_system: u8,
21046 #[doc = "Component ID (0 for broadcast)."]
21047 pub target_component: u8,
21048 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
21049 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21050 pub id_or_mac: [u8; 20],
21051 #[doc = "Indicates whether the unmanned aircraft is on the ground or in the air."]
21052 pub status: MavOdidStatus,
21053 #[doc = "Indicates the reference point for the height field."]
21054 pub height_reference: MavOdidHeightRef,
21055 #[doc = "The accuracy of the horizontal position."]
21056 pub horizontal_accuracy: MavOdidHorAcc,
21057 #[doc = "The accuracy of the vertical position."]
21058 pub vertical_accuracy: MavOdidVerAcc,
21059 #[doc = "The accuracy of the barometric altitude."]
21060 pub barometer_accuracy: MavOdidVerAcc,
21061 #[doc = "The accuracy of the horizontal and vertical speed."]
21062 pub speed_accuracy: MavOdidSpeedAcc,
21063 #[doc = "The accuracy of the timestamps."]
21064 pub timestamp_accuracy: MavOdidTimeAcc,
21065}
21066impl OPEN_DRONE_ID_LOCATION_DATA {
21067 pub const ENCODED_LEN: usize = 59usize;
21068 pub const DEFAULT: Self = Self {
21069 latitude: 0_i32,
21070 longitude: 0_i32,
21071 altitude_barometric: 0.0_f32,
21072 altitude_geodetic: 0.0_f32,
21073 height: 0.0_f32,
21074 timestamp: 0.0_f32,
21075 direction: 0_u16,
21076 speed_horizontal: 0_u16,
21077 speed_vertical: 0_i16,
21078 target_system: 0_u8,
21079 target_component: 0_u8,
21080 id_or_mac: [0_u8; 20usize],
21081 status: MavOdidStatus::DEFAULT,
21082 height_reference: MavOdidHeightRef::DEFAULT,
21083 horizontal_accuracy: MavOdidHorAcc::DEFAULT,
21084 vertical_accuracy: MavOdidVerAcc::DEFAULT,
21085 barometer_accuracy: MavOdidVerAcc::DEFAULT,
21086 speed_accuracy: MavOdidSpeedAcc::DEFAULT,
21087 timestamp_accuracy: MavOdidTimeAcc::DEFAULT,
21088 };
21089 #[cfg(feature = "arbitrary")]
21090 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21091 use arbitrary::{Arbitrary, Unstructured};
21092 let mut buf = [0u8; 1024];
21093 rng.fill_bytes(&mut buf);
21094 let mut unstructured = Unstructured::new(&buf);
21095 Self::arbitrary(&mut unstructured).unwrap_or_default()
21096 }
21097}
21098impl Default for OPEN_DRONE_ID_LOCATION_DATA {
21099 fn default() -> Self {
21100 Self::DEFAULT.clone()
21101 }
21102}
21103impl MessageData for OPEN_DRONE_ID_LOCATION_DATA {
21104 type Message = MavMessage;
21105 const ID: u32 = 12901u32;
21106 const NAME: &'static str = "OPEN_DRONE_ID_LOCATION";
21107 const EXTRA_CRC: u8 = 254u8;
21108 const ENCODED_LEN: usize = 59usize;
21109 fn deser(
21110 _version: MavlinkVersion,
21111 __input: &[u8],
21112 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21113 let avail_len = __input.len();
21114 let mut payload_buf = [0; Self::ENCODED_LEN];
21115 let mut buf = if avail_len < Self::ENCODED_LEN {
21116 payload_buf[0..avail_len].copy_from_slice(__input);
21117 Bytes::new(&payload_buf)
21118 } else {
21119 Bytes::new(__input)
21120 };
21121 let mut __struct = Self::default();
21122 __struct.latitude = buf.get_i32_le();
21123 __struct.longitude = buf.get_i32_le();
21124 __struct.altitude_barometric = buf.get_f32_le();
21125 __struct.altitude_geodetic = buf.get_f32_le();
21126 __struct.height = buf.get_f32_le();
21127 __struct.timestamp = buf.get_f32_le();
21128 __struct.direction = buf.get_u16_le();
21129 __struct.speed_horizontal = buf.get_u16_le();
21130 __struct.speed_vertical = buf.get_i16_le();
21131 __struct.target_system = buf.get_u8();
21132 __struct.target_component = buf.get_u8();
21133 for v in &mut __struct.id_or_mac {
21134 let val = buf.get_u8();
21135 *v = val;
21136 }
21137 let tmp = buf.get_u8();
21138 __struct.status =
21139 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21140 enum_type: "MavOdidStatus",
21141 value: tmp as u32,
21142 })?;
21143 let tmp = buf.get_u8();
21144 __struct.height_reference =
21145 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21146 enum_type: "MavOdidHeightRef",
21147 value: tmp as u32,
21148 })?;
21149 let tmp = buf.get_u8();
21150 __struct.horizontal_accuracy =
21151 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21152 enum_type: "MavOdidHorAcc",
21153 value: tmp as u32,
21154 })?;
21155 let tmp = buf.get_u8();
21156 __struct.vertical_accuracy =
21157 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21158 enum_type: "MavOdidVerAcc",
21159 value: tmp as u32,
21160 })?;
21161 let tmp = buf.get_u8();
21162 __struct.barometer_accuracy =
21163 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21164 enum_type: "MavOdidVerAcc",
21165 value: tmp as u32,
21166 })?;
21167 let tmp = buf.get_u8();
21168 __struct.speed_accuracy =
21169 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21170 enum_type: "MavOdidSpeedAcc",
21171 value: tmp as u32,
21172 })?;
21173 let tmp = buf.get_u8();
21174 __struct.timestamp_accuracy =
21175 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21176 enum_type: "MavOdidTimeAcc",
21177 value: tmp as u32,
21178 })?;
21179 Ok(__struct)
21180 }
21181 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21182 let mut __tmp = BytesMut::new(bytes);
21183 #[allow(clippy::absurd_extreme_comparisons)]
21184 #[allow(unused_comparisons)]
21185 if __tmp.remaining() < Self::ENCODED_LEN {
21186 panic!(
21187 "buffer is too small (need {} bytes, but got {})",
21188 Self::ENCODED_LEN,
21189 __tmp.remaining(),
21190 )
21191 }
21192 __tmp.put_i32_le(self.latitude);
21193 __tmp.put_i32_le(self.longitude);
21194 __tmp.put_f32_le(self.altitude_barometric);
21195 __tmp.put_f32_le(self.altitude_geodetic);
21196 __tmp.put_f32_le(self.height);
21197 __tmp.put_f32_le(self.timestamp);
21198 __tmp.put_u16_le(self.direction);
21199 __tmp.put_u16_le(self.speed_horizontal);
21200 __tmp.put_i16_le(self.speed_vertical);
21201 __tmp.put_u8(self.target_system);
21202 __tmp.put_u8(self.target_component);
21203 for val in &self.id_or_mac {
21204 __tmp.put_u8(*val);
21205 }
21206 __tmp.put_u8(self.status as u8);
21207 __tmp.put_u8(self.height_reference as u8);
21208 __tmp.put_u8(self.horizontal_accuracy as u8);
21209 __tmp.put_u8(self.vertical_accuracy as u8);
21210 __tmp.put_u8(self.barometer_accuracy as u8);
21211 __tmp.put_u8(self.speed_accuracy as u8);
21212 __tmp.put_u8(self.timestamp_accuracy as u8);
21213 if matches!(version, MavlinkVersion::V2) {
21214 let len = __tmp.len();
21215 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21216 } else {
21217 __tmp.len()
21218 }
21219 }
21220}
21221#[doc = "id: 12915"]
21222#[doc = "An OpenDroneID message pack is a container for multiple encoded OpenDroneID messages (i.e. not in the format given for the above message descriptions but after encoding into the compressed OpenDroneID byte format). Used e.g. when transmitting on Bluetooth 5.0 Long Range/Extended Advertising or on WiFi Neighbor Aware Networking or on WiFi Beacon."]
21223#[derive(Debug, Clone, PartialEq)]
21224#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21225#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21226pub struct OPEN_DRONE_ID_MESSAGE_PACK_DATA {
21227 #[doc = "System ID (0 for broadcast)."]
21228 pub target_system: u8,
21229 #[doc = "Component ID (0 for broadcast)."]
21230 pub target_component: u8,
21231 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
21232 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21233 pub id_or_mac: [u8; 20],
21234 #[doc = "This field must currently always be equal to 25 (bytes), since all encoded OpenDroneID messages are specified to have this length."]
21235 pub single_message_size: u8,
21236 #[doc = "Number of encoded messages in the pack (not the number of bytes). Allowed range is 1 - 9."]
21237 pub msg_pack_size: u8,
21238 #[doc = "Concatenation of encoded OpenDroneID messages. Shall be filled with nulls in the unused portion of the field."]
21239 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21240 pub messages: [u8; 225],
21241}
21242impl OPEN_DRONE_ID_MESSAGE_PACK_DATA {
21243 pub const ENCODED_LEN: usize = 249usize;
21244 pub const DEFAULT: Self = Self {
21245 target_system: 0_u8,
21246 target_component: 0_u8,
21247 id_or_mac: [0_u8; 20usize],
21248 single_message_size: 0_u8,
21249 msg_pack_size: 0_u8,
21250 messages: [0_u8; 225usize],
21251 };
21252 #[cfg(feature = "arbitrary")]
21253 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21254 use arbitrary::{Arbitrary, Unstructured};
21255 let mut buf = [0u8; 1024];
21256 rng.fill_bytes(&mut buf);
21257 let mut unstructured = Unstructured::new(&buf);
21258 Self::arbitrary(&mut unstructured).unwrap_or_default()
21259 }
21260}
21261impl Default for OPEN_DRONE_ID_MESSAGE_PACK_DATA {
21262 fn default() -> Self {
21263 Self::DEFAULT.clone()
21264 }
21265}
21266impl MessageData for OPEN_DRONE_ID_MESSAGE_PACK_DATA {
21267 type Message = MavMessage;
21268 const ID: u32 = 12915u32;
21269 const NAME: &'static str = "OPEN_DRONE_ID_MESSAGE_PACK";
21270 const EXTRA_CRC: u8 = 94u8;
21271 const ENCODED_LEN: usize = 249usize;
21272 fn deser(
21273 _version: MavlinkVersion,
21274 __input: &[u8],
21275 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21276 let avail_len = __input.len();
21277 let mut payload_buf = [0; Self::ENCODED_LEN];
21278 let mut buf = if avail_len < Self::ENCODED_LEN {
21279 payload_buf[0..avail_len].copy_from_slice(__input);
21280 Bytes::new(&payload_buf)
21281 } else {
21282 Bytes::new(__input)
21283 };
21284 let mut __struct = Self::default();
21285 __struct.target_system = buf.get_u8();
21286 __struct.target_component = buf.get_u8();
21287 for v in &mut __struct.id_or_mac {
21288 let val = buf.get_u8();
21289 *v = val;
21290 }
21291 __struct.single_message_size = buf.get_u8();
21292 __struct.msg_pack_size = buf.get_u8();
21293 for v in &mut __struct.messages {
21294 let val = buf.get_u8();
21295 *v = val;
21296 }
21297 Ok(__struct)
21298 }
21299 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21300 let mut __tmp = BytesMut::new(bytes);
21301 #[allow(clippy::absurd_extreme_comparisons)]
21302 #[allow(unused_comparisons)]
21303 if __tmp.remaining() < Self::ENCODED_LEN {
21304 panic!(
21305 "buffer is too small (need {} bytes, but got {})",
21306 Self::ENCODED_LEN,
21307 __tmp.remaining(),
21308 )
21309 }
21310 __tmp.put_u8(self.target_system);
21311 __tmp.put_u8(self.target_component);
21312 for val in &self.id_or_mac {
21313 __tmp.put_u8(*val);
21314 }
21315 __tmp.put_u8(self.single_message_size);
21316 __tmp.put_u8(self.msg_pack_size);
21317 for val in &self.messages {
21318 __tmp.put_u8(*val);
21319 }
21320 if matches!(version, MavlinkVersion::V2) {
21321 let len = __tmp.len();
21322 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21323 } else {
21324 __tmp.len()
21325 }
21326 }
21327}
21328#[doc = "id: 12905"]
21329#[doc = "Data for filling the OpenDroneID Operator ID message, which contains the CAA (Civil Aviation Authority) issued operator ID."]
21330#[derive(Debug, Clone, PartialEq)]
21331#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21332#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21333pub struct OPEN_DRONE_ID_OPERATOR_ID_DATA {
21334 #[doc = "System ID (0 for broadcast)."]
21335 pub target_system: u8,
21336 #[doc = "Component ID (0 for broadcast)."]
21337 pub target_component: u8,
21338 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
21339 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21340 pub id_or_mac: [u8; 20],
21341 #[doc = "Indicates the type of the operator_id field."]
21342 pub operator_id_type: MavOdidOperatorIdType,
21343 #[doc = "Text description or numeric value expressed as ASCII characters. Shall be filled with nulls in the unused portion of the field."]
21344 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21345 pub operator_id: [u8; 20],
21346}
21347impl OPEN_DRONE_ID_OPERATOR_ID_DATA {
21348 pub const ENCODED_LEN: usize = 43usize;
21349 pub const DEFAULT: Self = Self {
21350 target_system: 0_u8,
21351 target_component: 0_u8,
21352 id_or_mac: [0_u8; 20usize],
21353 operator_id_type: MavOdidOperatorIdType::DEFAULT,
21354 operator_id: [0_u8; 20usize],
21355 };
21356 #[cfg(feature = "arbitrary")]
21357 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21358 use arbitrary::{Arbitrary, Unstructured};
21359 let mut buf = [0u8; 1024];
21360 rng.fill_bytes(&mut buf);
21361 let mut unstructured = Unstructured::new(&buf);
21362 Self::arbitrary(&mut unstructured).unwrap_or_default()
21363 }
21364}
21365impl Default for OPEN_DRONE_ID_OPERATOR_ID_DATA {
21366 fn default() -> Self {
21367 Self::DEFAULT.clone()
21368 }
21369}
21370impl MessageData for OPEN_DRONE_ID_OPERATOR_ID_DATA {
21371 type Message = MavMessage;
21372 const ID: u32 = 12905u32;
21373 const NAME: &'static str = "OPEN_DRONE_ID_OPERATOR_ID";
21374 const EXTRA_CRC: u8 = 49u8;
21375 const ENCODED_LEN: usize = 43usize;
21376 fn deser(
21377 _version: MavlinkVersion,
21378 __input: &[u8],
21379 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21380 let avail_len = __input.len();
21381 let mut payload_buf = [0; Self::ENCODED_LEN];
21382 let mut buf = if avail_len < Self::ENCODED_LEN {
21383 payload_buf[0..avail_len].copy_from_slice(__input);
21384 Bytes::new(&payload_buf)
21385 } else {
21386 Bytes::new(__input)
21387 };
21388 let mut __struct = Self::default();
21389 __struct.target_system = buf.get_u8();
21390 __struct.target_component = buf.get_u8();
21391 for v in &mut __struct.id_or_mac {
21392 let val = buf.get_u8();
21393 *v = val;
21394 }
21395 let tmp = buf.get_u8();
21396 __struct.operator_id_type =
21397 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21398 enum_type: "MavOdidOperatorIdType",
21399 value: tmp as u32,
21400 })?;
21401 for v in &mut __struct.operator_id {
21402 let val = buf.get_u8();
21403 *v = val;
21404 }
21405 Ok(__struct)
21406 }
21407 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21408 let mut __tmp = BytesMut::new(bytes);
21409 #[allow(clippy::absurd_extreme_comparisons)]
21410 #[allow(unused_comparisons)]
21411 if __tmp.remaining() < Self::ENCODED_LEN {
21412 panic!(
21413 "buffer is too small (need {} bytes, but got {})",
21414 Self::ENCODED_LEN,
21415 __tmp.remaining(),
21416 )
21417 }
21418 __tmp.put_u8(self.target_system);
21419 __tmp.put_u8(self.target_component);
21420 for val in &self.id_or_mac {
21421 __tmp.put_u8(*val);
21422 }
21423 __tmp.put_u8(self.operator_id_type as u8);
21424 for val in &self.operator_id {
21425 __tmp.put_u8(*val);
21426 }
21427 if matches!(version, MavlinkVersion::V2) {
21428 let len = __tmp.len();
21429 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21430 } else {
21431 __tmp.len()
21432 }
21433 }
21434}
21435#[doc = "id: 12903"]
21436#[doc = "Data for filling the OpenDroneID Self ID message. The Self ID Message is an opportunity for the operator to (optionally) declare their identity and purpose of the flight. This message can provide additional information that could reduce the threat profile of a UA (Unmanned Aircraft) flying in a particular area or manner. This message can also be used to provide optional additional clarification in an emergency/remote ID system failure situation."]
21437#[derive(Debug, Clone, PartialEq)]
21438#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21439#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21440pub struct OPEN_DRONE_ID_SELF_ID_DATA {
21441 #[doc = "System ID (0 for broadcast)."]
21442 pub target_system: u8,
21443 #[doc = "Component ID (0 for broadcast)."]
21444 pub target_component: u8,
21445 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
21446 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21447 pub id_or_mac: [u8; 20],
21448 #[doc = "Indicates the type of the description field."]
21449 pub description_type: MavOdidDescType,
21450 #[doc = "Text description or numeric value expressed as ASCII characters. Shall be filled with nulls in the unused portion of the field."]
21451 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21452 pub description: [u8; 23],
21453}
21454impl OPEN_DRONE_ID_SELF_ID_DATA {
21455 pub const ENCODED_LEN: usize = 46usize;
21456 pub const DEFAULT: Self = Self {
21457 target_system: 0_u8,
21458 target_component: 0_u8,
21459 id_or_mac: [0_u8; 20usize],
21460 description_type: MavOdidDescType::DEFAULT,
21461 description: [0_u8; 23usize],
21462 };
21463 #[cfg(feature = "arbitrary")]
21464 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21465 use arbitrary::{Arbitrary, Unstructured};
21466 let mut buf = [0u8; 1024];
21467 rng.fill_bytes(&mut buf);
21468 let mut unstructured = Unstructured::new(&buf);
21469 Self::arbitrary(&mut unstructured).unwrap_or_default()
21470 }
21471}
21472impl Default for OPEN_DRONE_ID_SELF_ID_DATA {
21473 fn default() -> Self {
21474 Self::DEFAULT.clone()
21475 }
21476}
21477impl MessageData for OPEN_DRONE_ID_SELF_ID_DATA {
21478 type Message = MavMessage;
21479 const ID: u32 = 12903u32;
21480 const NAME: &'static str = "OPEN_DRONE_ID_SELF_ID";
21481 const EXTRA_CRC: u8 = 249u8;
21482 const ENCODED_LEN: usize = 46usize;
21483 fn deser(
21484 _version: MavlinkVersion,
21485 __input: &[u8],
21486 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21487 let avail_len = __input.len();
21488 let mut payload_buf = [0; Self::ENCODED_LEN];
21489 let mut buf = if avail_len < Self::ENCODED_LEN {
21490 payload_buf[0..avail_len].copy_from_slice(__input);
21491 Bytes::new(&payload_buf)
21492 } else {
21493 Bytes::new(__input)
21494 };
21495 let mut __struct = Self::default();
21496 __struct.target_system = buf.get_u8();
21497 __struct.target_component = buf.get_u8();
21498 for v in &mut __struct.id_or_mac {
21499 let val = buf.get_u8();
21500 *v = val;
21501 }
21502 let tmp = buf.get_u8();
21503 __struct.description_type =
21504 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21505 enum_type: "MavOdidDescType",
21506 value: tmp as u32,
21507 })?;
21508 for v in &mut __struct.description {
21509 let val = buf.get_u8();
21510 *v = val;
21511 }
21512 Ok(__struct)
21513 }
21514 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21515 let mut __tmp = BytesMut::new(bytes);
21516 #[allow(clippy::absurd_extreme_comparisons)]
21517 #[allow(unused_comparisons)]
21518 if __tmp.remaining() < Self::ENCODED_LEN {
21519 panic!(
21520 "buffer is too small (need {} bytes, but got {})",
21521 Self::ENCODED_LEN,
21522 __tmp.remaining(),
21523 )
21524 }
21525 __tmp.put_u8(self.target_system);
21526 __tmp.put_u8(self.target_component);
21527 for val in &self.id_or_mac {
21528 __tmp.put_u8(*val);
21529 }
21530 __tmp.put_u8(self.description_type as u8);
21531 for val in &self.description {
21532 __tmp.put_u8(*val);
21533 }
21534 if matches!(version, MavlinkVersion::V2) {
21535 let len = __tmp.len();
21536 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21537 } else {
21538 __tmp.len()
21539 }
21540 }
21541}
21542#[doc = "id: 12904"]
21543#[doc = "Data for filling the OpenDroneID System message. The System Message contains general system information including the operator location/altitude and possible aircraft group and/or category/class information."]
21544#[derive(Debug, Clone, PartialEq)]
21545#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21546#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21547pub struct OPEN_DRONE_ID_SYSTEM_DATA {
21548 #[doc = "Latitude of the operator. If unknown: 0 (both Lat/Lon)."]
21549 pub operator_latitude: i32,
21550 #[doc = "Longitude of the operator. If unknown: 0 (both Lat/Lon)."]
21551 pub operator_longitude: i32,
21552 #[doc = "Area Operations Ceiling relative to WGS84. If unknown: -1000 m. Used only for swarms/multiple UA."]
21553 pub area_ceiling: f32,
21554 #[doc = "Area Operations Floor relative to WGS84. If unknown: -1000 m. Used only for swarms/multiple UA."]
21555 pub area_floor: f32,
21556 #[doc = "Geodetic altitude of the operator relative to WGS84. If unknown: -1000 m."]
21557 pub operator_altitude_geo: f32,
21558 #[doc = "32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019."]
21559 pub timestamp: u32,
21560 #[doc = "Number of aircraft in the area, group or formation (default 1). Used only for swarms/multiple UA."]
21561 pub area_count: u16,
21562 #[doc = "Radius of the cylindrical area of the group or formation (default 0). Used only for swarms/multiple UA."]
21563 pub area_radius: u16,
21564 #[doc = "System ID (0 for broadcast)."]
21565 pub target_system: u8,
21566 #[doc = "Component ID (0 for broadcast)."]
21567 pub target_component: u8,
21568 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
21569 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21570 pub id_or_mac: [u8; 20],
21571 #[doc = "Specifies the operator location type."]
21572 pub operator_location_type: MavOdidOperatorLocationType,
21573 #[doc = "Specifies the classification type of the UA."]
21574 pub classification_type: MavOdidClassificationType,
21575 #[doc = "When classification_type is MAV_ODID_CLASSIFICATION_TYPE_EU, specifies the category of the UA."]
21576 pub category_eu: MavOdidCategoryEu,
21577 #[doc = "When classification_type is MAV_ODID_CLASSIFICATION_TYPE_EU, specifies the class of the UA."]
21578 pub class_eu: MavOdidClassEu,
21579}
21580impl OPEN_DRONE_ID_SYSTEM_DATA {
21581 pub const ENCODED_LEN: usize = 54usize;
21582 pub const DEFAULT: Self = Self {
21583 operator_latitude: 0_i32,
21584 operator_longitude: 0_i32,
21585 area_ceiling: 0.0_f32,
21586 area_floor: 0.0_f32,
21587 operator_altitude_geo: 0.0_f32,
21588 timestamp: 0_u32,
21589 area_count: 0_u16,
21590 area_radius: 0_u16,
21591 target_system: 0_u8,
21592 target_component: 0_u8,
21593 id_or_mac: [0_u8; 20usize],
21594 operator_location_type: MavOdidOperatorLocationType::DEFAULT,
21595 classification_type: MavOdidClassificationType::DEFAULT,
21596 category_eu: MavOdidCategoryEu::DEFAULT,
21597 class_eu: MavOdidClassEu::DEFAULT,
21598 };
21599 #[cfg(feature = "arbitrary")]
21600 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21601 use arbitrary::{Arbitrary, Unstructured};
21602 let mut buf = [0u8; 1024];
21603 rng.fill_bytes(&mut buf);
21604 let mut unstructured = Unstructured::new(&buf);
21605 Self::arbitrary(&mut unstructured).unwrap_or_default()
21606 }
21607}
21608impl Default for OPEN_DRONE_ID_SYSTEM_DATA {
21609 fn default() -> Self {
21610 Self::DEFAULT.clone()
21611 }
21612}
21613impl MessageData for OPEN_DRONE_ID_SYSTEM_DATA {
21614 type Message = MavMessage;
21615 const ID: u32 = 12904u32;
21616 const NAME: &'static str = "OPEN_DRONE_ID_SYSTEM";
21617 const EXTRA_CRC: u8 = 77u8;
21618 const ENCODED_LEN: usize = 54usize;
21619 fn deser(
21620 _version: MavlinkVersion,
21621 __input: &[u8],
21622 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21623 let avail_len = __input.len();
21624 let mut payload_buf = [0; Self::ENCODED_LEN];
21625 let mut buf = if avail_len < Self::ENCODED_LEN {
21626 payload_buf[0..avail_len].copy_from_slice(__input);
21627 Bytes::new(&payload_buf)
21628 } else {
21629 Bytes::new(__input)
21630 };
21631 let mut __struct = Self::default();
21632 __struct.operator_latitude = buf.get_i32_le();
21633 __struct.operator_longitude = buf.get_i32_le();
21634 __struct.area_ceiling = buf.get_f32_le();
21635 __struct.area_floor = buf.get_f32_le();
21636 __struct.operator_altitude_geo = buf.get_f32_le();
21637 __struct.timestamp = buf.get_u32_le();
21638 __struct.area_count = buf.get_u16_le();
21639 __struct.area_radius = buf.get_u16_le();
21640 __struct.target_system = buf.get_u8();
21641 __struct.target_component = buf.get_u8();
21642 for v in &mut __struct.id_or_mac {
21643 let val = buf.get_u8();
21644 *v = val;
21645 }
21646 let tmp = buf.get_u8();
21647 __struct.operator_location_type =
21648 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21649 enum_type: "MavOdidOperatorLocationType",
21650 value: tmp as u32,
21651 })?;
21652 let tmp = buf.get_u8();
21653 __struct.classification_type =
21654 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21655 enum_type: "MavOdidClassificationType",
21656 value: tmp as u32,
21657 })?;
21658 let tmp = buf.get_u8();
21659 __struct.category_eu =
21660 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21661 enum_type: "MavOdidCategoryEu",
21662 value: tmp as u32,
21663 })?;
21664 let tmp = buf.get_u8();
21665 __struct.class_eu =
21666 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21667 enum_type: "MavOdidClassEu",
21668 value: tmp as u32,
21669 })?;
21670 Ok(__struct)
21671 }
21672 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21673 let mut __tmp = BytesMut::new(bytes);
21674 #[allow(clippy::absurd_extreme_comparisons)]
21675 #[allow(unused_comparisons)]
21676 if __tmp.remaining() < Self::ENCODED_LEN {
21677 panic!(
21678 "buffer is too small (need {} bytes, but got {})",
21679 Self::ENCODED_LEN,
21680 __tmp.remaining(),
21681 )
21682 }
21683 __tmp.put_i32_le(self.operator_latitude);
21684 __tmp.put_i32_le(self.operator_longitude);
21685 __tmp.put_f32_le(self.area_ceiling);
21686 __tmp.put_f32_le(self.area_floor);
21687 __tmp.put_f32_le(self.operator_altitude_geo);
21688 __tmp.put_u32_le(self.timestamp);
21689 __tmp.put_u16_le(self.area_count);
21690 __tmp.put_u16_le(self.area_radius);
21691 __tmp.put_u8(self.target_system);
21692 __tmp.put_u8(self.target_component);
21693 for val in &self.id_or_mac {
21694 __tmp.put_u8(*val);
21695 }
21696 __tmp.put_u8(self.operator_location_type as u8);
21697 __tmp.put_u8(self.classification_type as u8);
21698 __tmp.put_u8(self.category_eu as u8);
21699 __tmp.put_u8(self.class_eu as u8);
21700 if matches!(version, MavlinkVersion::V2) {
21701 let len = __tmp.len();
21702 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21703 } else {
21704 __tmp.len()
21705 }
21706 }
21707}
21708#[doc = "id: 12919"]
21709#[doc = "Update the data in the OPEN_DRONE_ID_SYSTEM message with new location information. This can be sent to update the location information for the operator when no other information in the SYSTEM message has changed. This message allows for efficient operation on radio links which have limited uplink bandwidth while meeting requirements for update frequency of the operator location."]
21710#[derive(Debug, Clone, PartialEq)]
21711#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21712#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21713pub struct OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
21714 #[doc = "Latitude of the operator. If unknown: 0 (both Lat/Lon)."]
21715 pub operator_latitude: i32,
21716 #[doc = "Longitude of the operator. If unknown: 0 (both Lat/Lon)."]
21717 pub operator_longitude: i32,
21718 #[doc = "Geodetic altitude of the operator relative to WGS84. If unknown: -1000 m."]
21719 pub operator_altitude_geo: f32,
21720 #[doc = "32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019."]
21721 pub timestamp: u32,
21722 #[doc = "System ID (0 for broadcast)."]
21723 pub target_system: u8,
21724 #[doc = "Component ID (0 for broadcast)."]
21725 pub target_component: u8,
21726}
21727impl OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
21728 pub const ENCODED_LEN: usize = 18usize;
21729 pub const DEFAULT: Self = Self {
21730 operator_latitude: 0_i32,
21731 operator_longitude: 0_i32,
21732 operator_altitude_geo: 0.0_f32,
21733 timestamp: 0_u32,
21734 target_system: 0_u8,
21735 target_component: 0_u8,
21736 };
21737 #[cfg(feature = "arbitrary")]
21738 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21739 use arbitrary::{Arbitrary, Unstructured};
21740 let mut buf = [0u8; 1024];
21741 rng.fill_bytes(&mut buf);
21742 let mut unstructured = Unstructured::new(&buf);
21743 Self::arbitrary(&mut unstructured).unwrap_or_default()
21744 }
21745}
21746impl Default for OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
21747 fn default() -> Self {
21748 Self::DEFAULT.clone()
21749 }
21750}
21751impl MessageData for OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
21752 type Message = MavMessage;
21753 const ID: u32 = 12919u32;
21754 const NAME: &'static str = "OPEN_DRONE_ID_SYSTEM_UPDATE";
21755 const EXTRA_CRC: u8 = 7u8;
21756 const ENCODED_LEN: usize = 18usize;
21757 fn deser(
21758 _version: MavlinkVersion,
21759 __input: &[u8],
21760 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21761 let avail_len = __input.len();
21762 let mut payload_buf = [0; Self::ENCODED_LEN];
21763 let mut buf = if avail_len < Self::ENCODED_LEN {
21764 payload_buf[0..avail_len].copy_from_slice(__input);
21765 Bytes::new(&payload_buf)
21766 } else {
21767 Bytes::new(__input)
21768 };
21769 let mut __struct = Self::default();
21770 __struct.operator_latitude = buf.get_i32_le();
21771 __struct.operator_longitude = buf.get_i32_le();
21772 __struct.operator_altitude_geo = buf.get_f32_le();
21773 __struct.timestamp = buf.get_u32_le();
21774 __struct.target_system = buf.get_u8();
21775 __struct.target_component = buf.get_u8();
21776 Ok(__struct)
21777 }
21778 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21779 let mut __tmp = BytesMut::new(bytes);
21780 #[allow(clippy::absurd_extreme_comparisons)]
21781 #[allow(unused_comparisons)]
21782 if __tmp.remaining() < Self::ENCODED_LEN {
21783 panic!(
21784 "buffer is too small (need {} bytes, but got {})",
21785 Self::ENCODED_LEN,
21786 __tmp.remaining(),
21787 )
21788 }
21789 __tmp.put_i32_le(self.operator_latitude);
21790 __tmp.put_i32_le(self.operator_longitude);
21791 __tmp.put_f32_le(self.operator_altitude_geo);
21792 __tmp.put_u32_le(self.timestamp);
21793 __tmp.put_u8(self.target_system);
21794 __tmp.put_u8(self.target_component);
21795 if matches!(version, MavlinkVersion::V2) {
21796 let len = __tmp.len();
21797 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21798 } else {
21799 __tmp.len()
21800 }
21801 }
21802}
21803#[doc = "id: 100"]
21804#[doc = "Optical flow from a flow sensor (e.g. optical mouse sensor)."]
21805#[derive(Debug, Clone, PartialEq)]
21806#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21807#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21808pub struct OPTICAL_FLOW_DATA {
21809 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
21810 pub time_usec: u64,
21811 #[doc = "Flow in x-sensor direction, angular-speed compensated"]
21812 pub flow_comp_m_x: f32,
21813 #[doc = "Flow in y-sensor direction, angular-speed compensated"]
21814 pub flow_comp_m_y: f32,
21815 #[doc = "Ground distance. Positive value: distance known. Negative value: Unknown distance"]
21816 pub ground_distance: f32,
21817 #[doc = "Flow in x-sensor direction"]
21818 pub flow_x: i16,
21819 #[doc = "Flow in y-sensor direction"]
21820 pub flow_y: i16,
21821 #[doc = "Sensor ID"]
21822 pub sensor_id: u8,
21823 #[doc = "Optical flow quality / confidence. 0: bad, 255: maximum quality"]
21824 pub quality: u8,
21825 #[doc = "Flow rate about X axis"]
21826 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
21827 pub flow_rate_x: f32,
21828 #[doc = "Flow rate about Y axis"]
21829 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
21830 pub flow_rate_y: f32,
21831}
21832impl OPTICAL_FLOW_DATA {
21833 pub const ENCODED_LEN: usize = 34usize;
21834 pub const DEFAULT: Self = Self {
21835 time_usec: 0_u64,
21836 flow_comp_m_x: 0.0_f32,
21837 flow_comp_m_y: 0.0_f32,
21838 ground_distance: 0.0_f32,
21839 flow_x: 0_i16,
21840 flow_y: 0_i16,
21841 sensor_id: 0_u8,
21842 quality: 0_u8,
21843 flow_rate_x: 0.0_f32,
21844 flow_rate_y: 0.0_f32,
21845 };
21846 #[cfg(feature = "arbitrary")]
21847 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21848 use arbitrary::{Arbitrary, Unstructured};
21849 let mut buf = [0u8; 1024];
21850 rng.fill_bytes(&mut buf);
21851 let mut unstructured = Unstructured::new(&buf);
21852 Self::arbitrary(&mut unstructured).unwrap_or_default()
21853 }
21854}
21855impl Default for OPTICAL_FLOW_DATA {
21856 fn default() -> Self {
21857 Self::DEFAULT.clone()
21858 }
21859}
21860impl MessageData for OPTICAL_FLOW_DATA {
21861 type Message = MavMessage;
21862 const ID: u32 = 100u32;
21863 const NAME: &'static str = "OPTICAL_FLOW";
21864 const EXTRA_CRC: u8 = 175u8;
21865 const ENCODED_LEN: usize = 34usize;
21866 fn deser(
21867 _version: MavlinkVersion,
21868 __input: &[u8],
21869 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21870 let avail_len = __input.len();
21871 let mut payload_buf = [0; Self::ENCODED_LEN];
21872 let mut buf = if avail_len < Self::ENCODED_LEN {
21873 payload_buf[0..avail_len].copy_from_slice(__input);
21874 Bytes::new(&payload_buf)
21875 } else {
21876 Bytes::new(__input)
21877 };
21878 let mut __struct = Self::default();
21879 __struct.time_usec = buf.get_u64_le();
21880 __struct.flow_comp_m_x = buf.get_f32_le();
21881 __struct.flow_comp_m_y = buf.get_f32_le();
21882 __struct.ground_distance = buf.get_f32_le();
21883 __struct.flow_x = buf.get_i16_le();
21884 __struct.flow_y = buf.get_i16_le();
21885 __struct.sensor_id = buf.get_u8();
21886 __struct.quality = buf.get_u8();
21887 __struct.flow_rate_x = buf.get_f32_le();
21888 __struct.flow_rate_y = buf.get_f32_le();
21889 Ok(__struct)
21890 }
21891 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21892 let mut __tmp = BytesMut::new(bytes);
21893 #[allow(clippy::absurd_extreme_comparisons)]
21894 #[allow(unused_comparisons)]
21895 if __tmp.remaining() < Self::ENCODED_LEN {
21896 panic!(
21897 "buffer is too small (need {} bytes, but got {})",
21898 Self::ENCODED_LEN,
21899 __tmp.remaining(),
21900 )
21901 }
21902 __tmp.put_u64_le(self.time_usec);
21903 __tmp.put_f32_le(self.flow_comp_m_x);
21904 __tmp.put_f32_le(self.flow_comp_m_y);
21905 __tmp.put_f32_le(self.ground_distance);
21906 __tmp.put_i16_le(self.flow_x);
21907 __tmp.put_i16_le(self.flow_y);
21908 __tmp.put_u8(self.sensor_id);
21909 __tmp.put_u8(self.quality);
21910 __tmp.put_f32_le(self.flow_rate_x);
21911 __tmp.put_f32_le(self.flow_rate_y);
21912 if matches!(version, MavlinkVersion::V2) {
21913 let len = __tmp.len();
21914 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21915 } else {
21916 __tmp.len()
21917 }
21918 }
21919}
21920#[doc = "id: 106"]
21921#[doc = "Optical flow from an angular rate flow sensor (e.g. PX4FLOW or mouse sensor)."]
21922#[derive(Debug, Clone, PartialEq)]
21923#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21924#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21925pub struct OPTICAL_FLOW_RAD_DATA {
21926 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
21927 pub time_usec: u64,
21928 #[doc = "Integration time. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the."]
21929 pub integration_time_us: u32,
21930 #[doc = "Flow around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.)"]
21931 pub integrated_x: f32,
21932 #[doc = "Flow around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.)"]
21933 pub integrated_y: f32,
21934 #[doc = "RH rotation around X axis"]
21935 pub integrated_xgyro: f32,
21936 #[doc = "RH rotation around Y axis"]
21937 pub integrated_ygyro: f32,
21938 #[doc = "RH rotation around Z axis"]
21939 pub integrated_zgyro: f32,
21940 #[doc = "Time since the distance was sampled."]
21941 pub time_delta_distance_us: u32,
21942 #[doc = "Distance to the center of the flow field. Positive value (including zero): distance known. Negative value: Unknown distance."]
21943 pub distance: f32,
21944 #[doc = "Temperature"]
21945 pub temperature: i16,
21946 #[doc = "Sensor ID"]
21947 pub sensor_id: u8,
21948 #[doc = "Optical flow quality / confidence. 0: no valid flow, 255: maximum quality"]
21949 pub quality: u8,
21950}
21951impl OPTICAL_FLOW_RAD_DATA {
21952 pub const ENCODED_LEN: usize = 44usize;
21953 pub const DEFAULT: Self = Self {
21954 time_usec: 0_u64,
21955 integration_time_us: 0_u32,
21956 integrated_x: 0.0_f32,
21957 integrated_y: 0.0_f32,
21958 integrated_xgyro: 0.0_f32,
21959 integrated_ygyro: 0.0_f32,
21960 integrated_zgyro: 0.0_f32,
21961 time_delta_distance_us: 0_u32,
21962 distance: 0.0_f32,
21963 temperature: 0_i16,
21964 sensor_id: 0_u8,
21965 quality: 0_u8,
21966 };
21967 #[cfg(feature = "arbitrary")]
21968 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21969 use arbitrary::{Arbitrary, Unstructured};
21970 let mut buf = [0u8; 1024];
21971 rng.fill_bytes(&mut buf);
21972 let mut unstructured = Unstructured::new(&buf);
21973 Self::arbitrary(&mut unstructured).unwrap_or_default()
21974 }
21975}
21976impl Default for OPTICAL_FLOW_RAD_DATA {
21977 fn default() -> Self {
21978 Self::DEFAULT.clone()
21979 }
21980}
21981impl MessageData for OPTICAL_FLOW_RAD_DATA {
21982 type Message = MavMessage;
21983 const ID: u32 = 106u32;
21984 const NAME: &'static str = "OPTICAL_FLOW_RAD";
21985 const EXTRA_CRC: u8 = 138u8;
21986 const ENCODED_LEN: usize = 44usize;
21987 fn deser(
21988 _version: MavlinkVersion,
21989 __input: &[u8],
21990 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21991 let avail_len = __input.len();
21992 let mut payload_buf = [0; Self::ENCODED_LEN];
21993 let mut buf = if avail_len < Self::ENCODED_LEN {
21994 payload_buf[0..avail_len].copy_from_slice(__input);
21995 Bytes::new(&payload_buf)
21996 } else {
21997 Bytes::new(__input)
21998 };
21999 let mut __struct = Self::default();
22000 __struct.time_usec = buf.get_u64_le();
22001 __struct.integration_time_us = buf.get_u32_le();
22002 __struct.integrated_x = buf.get_f32_le();
22003 __struct.integrated_y = buf.get_f32_le();
22004 __struct.integrated_xgyro = buf.get_f32_le();
22005 __struct.integrated_ygyro = buf.get_f32_le();
22006 __struct.integrated_zgyro = buf.get_f32_le();
22007 __struct.time_delta_distance_us = buf.get_u32_le();
22008 __struct.distance = buf.get_f32_le();
22009 __struct.temperature = buf.get_i16_le();
22010 __struct.sensor_id = buf.get_u8();
22011 __struct.quality = buf.get_u8();
22012 Ok(__struct)
22013 }
22014 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22015 let mut __tmp = BytesMut::new(bytes);
22016 #[allow(clippy::absurd_extreme_comparisons)]
22017 #[allow(unused_comparisons)]
22018 if __tmp.remaining() < Self::ENCODED_LEN {
22019 panic!(
22020 "buffer is too small (need {} bytes, but got {})",
22021 Self::ENCODED_LEN,
22022 __tmp.remaining(),
22023 )
22024 }
22025 __tmp.put_u64_le(self.time_usec);
22026 __tmp.put_u32_le(self.integration_time_us);
22027 __tmp.put_f32_le(self.integrated_x);
22028 __tmp.put_f32_le(self.integrated_y);
22029 __tmp.put_f32_le(self.integrated_xgyro);
22030 __tmp.put_f32_le(self.integrated_ygyro);
22031 __tmp.put_f32_le(self.integrated_zgyro);
22032 __tmp.put_u32_le(self.time_delta_distance_us);
22033 __tmp.put_f32_le(self.distance);
22034 __tmp.put_i16_le(self.temperature);
22035 __tmp.put_u8(self.sensor_id);
22036 __tmp.put_u8(self.quality);
22037 if matches!(version, MavlinkVersion::V2) {
22038 let len = __tmp.len();
22039 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22040 } else {
22041 __tmp.len()
22042 }
22043 }
22044}
22045#[doc = "id: 360"]
22046#[doc = "Vehicle status report that is sent out while orbit execution is in progress (see MAV_CMD_DO_ORBIT)."]
22047#[derive(Debug, Clone, PartialEq)]
22048#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22049#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22050pub struct ORBIT_EXECUTION_STATUS_DATA {
22051 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
22052 pub time_usec: u64,
22053 #[doc = "Radius of the orbit circle. Positive values orbit clockwise, negative values orbit counter-clockwise."]
22054 pub radius: f32,
22055 #[doc = "X coordinate of center point. Coordinate system depends on frame field: local = x position in meters * 1e4, global = latitude in degrees * 1e7."]
22056 pub x: i32,
22057 #[doc = "Y coordinate of center point. Coordinate system depends on frame field: local = x position in meters * 1e4, global = latitude in degrees * 1e7."]
22058 pub y: i32,
22059 #[doc = "Altitude of center point. Coordinate system depends on frame field."]
22060 pub z: f32,
22061 #[doc = "The coordinate system of the fields: x, y, z."]
22062 pub frame: MavFrame,
22063}
22064impl ORBIT_EXECUTION_STATUS_DATA {
22065 pub const ENCODED_LEN: usize = 25usize;
22066 pub const DEFAULT: Self = Self {
22067 time_usec: 0_u64,
22068 radius: 0.0_f32,
22069 x: 0_i32,
22070 y: 0_i32,
22071 z: 0.0_f32,
22072 frame: MavFrame::DEFAULT,
22073 };
22074 #[cfg(feature = "arbitrary")]
22075 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22076 use arbitrary::{Arbitrary, Unstructured};
22077 let mut buf = [0u8; 1024];
22078 rng.fill_bytes(&mut buf);
22079 let mut unstructured = Unstructured::new(&buf);
22080 Self::arbitrary(&mut unstructured).unwrap_or_default()
22081 }
22082}
22083impl Default for ORBIT_EXECUTION_STATUS_DATA {
22084 fn default() -> Self {
22085 Self::DEFAULT.clone()
22086 }
22087}
22088impl MessageData for ORBIT_EXECUTION_STATUS_DATA {
22089 type Message = MavMessage;
22090 const ID: u32 = 360u32;
22091 const NAME: &'static str = "ORBIT_EXECUTION_STATUS";
22092 const EXTRA_CRC: u8 = 11u8;
22093 const ENCODED_LEN: usize = 25usize;
22094 fn deser(
22095 _version: MavlinkVersion,
22096 __input: &[u8],
22097 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22098 let avail_len = __input.len();
22099 let mut payload_buf = [0; Self::ENCODED_LEN];
22100 let mut buf = if avail_len < Self::ENCODED_LEN {
22101 payload_buf[0..avail_len].copy_from_slice(__input);
22102 Bytes::new(&payload_buf)
22103 } else {
22104 Bytes::new(__input)
22105 };
22106 let mut __struct = Self::default();
22107 __struct.time_usec = buf.get_u64_le();
22108 __struct.radius = buf.get_f32_le();
22109 __struct.x = buf.get_i32_le();
22110 __struct.y = buf.get_i32_le();
22111 __struct.z = buf.get_f32_le();
22112 let tmp = buf.get_u8();
22113 __struct.frame =
22114 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22115 enum_type: "MavFrame",
22116 value: tmp as u32,
22117 })?;
22118 Ok(__struct)
22119 }
22120 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22121 let mut __tmp = BytesMut::new(bytes);
22122 #[allow(clippy::absurd_extreme_comparisons)]
22123 #[allow(unused_comparisons)]
22124 if __tmp.remaining() < Self::ENCODED_LEN {
22125 panic!(
22126 "buffer is too small (need {} bytes, but got {})",
22127 Self::ENCODED_LEN,
22128 __tmp.remaining(),
22129 )
22130 }
22131 __tmp.put_u64_le(self.time_usec);
22132 __tmp.put_f32_le(self.radius);
22133 __tmp.put_i32_le(self.x);
22134 __tmp.put_i32_le(self.y);
22135 __tmp.put_f32_le(self.z);
22136 __tmp.put_u8(self.frame as u8);
22137 if matches!(version, MavlinkVersion::V2) {
22138 let len = __tmp.len();
22139 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22140 } else {
22141 __tmp.len()
22142 }
22143 }
22144}
22145#[doc = "id: 324"]
22146#[doc = "Response from a PARAM_EXT_SET message."]
22147#[derive(Debug, Clone, PartialEq)]
22148#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22149#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22150pub struct PARAM_EXT_ACK_DATA {
22151 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
22152 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22153 pub param_id: [u8; 16],
22154 #[doc = "Parameter value (new value if PARAM_ACK_ACCEPTED, current value otherwise)"]
22155 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22156 pub param_value: [u8; 128],
22157 #[doc = "Parameter type."]
22158 pub param_type: MavParamExtType,
22159 #[doc = "Result code."]
22160 pub param_result: ParamAck,
22161}
22162impl PARAM_EXT_ACK_DATA {
22163 pub const ENCODED_LEN: usize = 146usize;
22164 pub const DEFAULT: Self = Self {
22165 param_id: [0_u8; 16usize],
22166 param_value: [0_u8; 128usize],
22167 param_type: MavParamExtType::DEFAULT,
22168 param_result: ParamAck::DEFAULT,
22169 };
22170 #[cfg(feature = "arbitrary")]
22171 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22172 use arbitrary::{Arbitrary, Unstructured};
22173 let mut buf = [0u8; 1024];
22174 rng.fill_bytes(&mut buf);
22175 let mut unstructured = Unstructured::new(&buf);
22176 Self::arbitrary(&mut unstructured).unwrap_or_default()
22177 }
22178}
22179impl Default for PARAM_EXT_ACK_DATA {
22180 fn default() -> Self {
22181 Self::DEFAULT.clone()
22182 }
22183}
22184impl MessageData for PARAM_EXT_ACK_DATA {
22185 type Message = MavMessage;
22186 const ID: u32 = 324u32;
22187 const NAME: &'static str = "PARAM_EXT_ACK";
22188 const EXTRA_CRC: u8 = 132u8;
22189 const ENCODED_LEN: usize = 146usize;
22190 fn deser(
22191 _version: MavlinkVersion,
22192 __input: &[u8],
22193 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22194 let avail_len = __input.len();
22195 let mut payload_buf = [0; Self::ENCODED_LEN];
22196 let mut buf = if avail_len < Self::ENCODED_LEN {
22197 payload_buf[0..avail_len].copy_from_slice(__input);
22198 Bytes::new(&payload_buf)
22199 } else {
22200 Bytes::new(__input)
22201 };
22202 let mut __struct = Self::default();
22203 for v in &mut __struct.param_id {
22204 let val = buf.get_u8();
22205 *v = val;
22206 }
22207 for v in &mut __struct.param_value {
22208 let val = buf.get_u8();
22209 *v = val;
22210 }
22211 let tmp = buf.get_u8();
22212 __struct.param_type =
22213 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22214 enum_type: "MavParamExtType",
22215 value: tmp as u32,
22216 })?;
22217 let tmp = buf.get_u8();
22218 __struct.param_result =
22219 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22220 enum_type: "ParamAck",
22221 value: tmp as u32,
22222 })?;
22223 Ok(__struct)
22224 }
22225 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22226 let mut __tmp = BytesMut::new(bytes);
22227 #[allow(clippy::absurd_extreme_comparisons)]
22228 #[allow(unused_comparisons)]
22229 if __tmp.remaining() < Self::ENCODED_LEN {
22230 panic!(
22231 "buffer is too small (need {} bytes, but got {})",
22232 Self::ENCODED_LEN,
22233 __tmp.remaining(),
22234 )
22235 }
22236 for val in &self.param_id {
22237 __tmp.put_u8(*val);
22238 }
22239 for val in &self.param_value {
22240 __tmp.put_u8(*val);
22241 }
22242 __tmp.put_u8(self.param_type as u8);
22243 __tmp.put_u8(self.param_result as u8);
22244 if matches!(version, MavlinkVersion::V2) {
22245 let len = __tmp.len();
22246 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22247 } else {
22248 __tmp.len()
22249 }
22250 }
22251}
22252#[doc = "id: 321"]
22253#[doc = "Request all parameters of this component. All parameters should be emitted in response as PARAM_EXT_VALUE."]
22254#[derive(Debug, Clone, PartialEq)]
22255#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22256#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22257pub struct PARAM_EXT_REQUEST_LIST_DATA {
22258 #[doc = "System ID"]
22259 pub target_system: u8,
22260 #[doc = "Component ID"]
22261 pub target_component: u8,
22262}
22263impl PARAM_EXT_REQUEST_LIST_DATA {
22264 pub const ENCODED_LEN: usize = 2usize;
22265 pub const DEFAULT: Self = Self {
22266 target_system: 0_u8,
22267 target_component: 0_u8,
22268 };
22269 #[cfg(feature = "arbitrary")]
22270 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22271 use arbitrary::{Arbitrary, Unstructured};
22272 let mut buf = [0u8; 1024];
22273 rng.fill_bytes(&mut buf);
22274 let mut unstructured = Unstructured::new(&buf);
22275 Self::arbitrary(&mut unstructured).unwrap_or_default()
22276 }
22277}
22278impl Default for PARAM_EXT_REQUEST_LIST_DATA {
22279 fn default() -> Self {
22280 Self::DEFAULT.clone()
22281 }
22282}
22283impl MessageData for PARAM_EXT_REQUEST_LIST_DATA {
22284 type Message = MavMessage;
22285 const ID: u32 = 321u32;
22286 const NAME: &'static str = "PARAM_EXT_REQUEST_LIST";
22287 const EXTRA_CRC: u8 = 88u8;
22288 const ENCODED_LEN: usize = 2usize;
22289 fn deser(
22290 _version: MavlinkVersion,
22291 __input: &[u8],
22292 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22293 let avail_len = __input.len();
22294 let mut payload_buf = [0; Self::ENCODED_LEN];
22295 let mut buf = if avail_len < Self::ENCODED_LEN {
22296 payload_buf[0..avail_len].copy_from_slice(__input);
22297 Bytes::new(&payload_buf)
22298 } else {
22299 Bytes::new(__input)
22300 };
22301 let mut __struct = Self::default();
22302 __struct.target_system = buf.get_u8();
22303 __struct.target_component = buf.get_u8();
22304 Ok(__struct)
22305 }
22306 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22307 let mut __tmp = BytesMut::new(bytes);
22308 #[allow(clippy::absurd_extreme_comparisons)]
22309 #[allow(unused_comparisons)]
22310 if __tmp.remaining() < Self::ENCODED_LEN {
22311 panic!(
22312 "buffer is too small (need {} bytes, but got {})",
22313 Self::ENCODED_LEN,
22314 __tmp.remaining(),
22315 )
22316 }
22317 __tmp.put_u8(self.target_system);
22318 __tmp.put_u8(self.target_component);
22319 if matches!(version, MavlinkVersion::V2) {
22320 let len = __tmp.len();
22321 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22322 } else {
22323 __tmp.len()
22324 }
22325 }
22326}
22327#[doc = "id: 320"]
22328#[doc = "Request to read the value of a parameter with either the param_id string id or param_index. PARAM_EXT_VALUE should be emitted in response."]
22329#[derive(Debug, Clone, PartialEq)]
22330#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22331#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22332pub struct PARAM_EXT_REQUEST_READ_DATA {
22333 #[doc = "Parameter index. Set to -1 to use the Parameter ID field as identifier (else param_id will be ignored)"]
22334 pub param_index: i16,
22335 #[doc = "System ID"]
22336 pub target_system: u8,
22337 #[doc = "Component ID"]
22338 pub target_component: u8,
22339 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
22340 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22341 pub param_id: [u8; 16],
22342}
22343impl PARAM_EXT_REQUEST_READ_DATA {
22344 pub const ENCODED_LEN: usize = 20usize;
22345 pub const DEFAULT: Self = Self {
22346 param_index: 0_i16,
22347 target_system: 0_u8,
22348 target_component: 0_u8,
22349 param_id: [0_u8; 16usize],
22350 };
22351 #[cfg(feature = "arbitrary")]
22352 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22353 use arbitrary::{Arbitrary, Unstructured};
22354 let mut buf = [0u8; 1024];
22355 rng.fill_bytes(&mut buf);
22356 let mut unstructured = Unstructured::new(&buf);
22357 Self::arbitrary(&mut unstructured).unwrap_or_default()
22358 }
22359}
22360impl Default for PARAM_EXT_REQUEST_READ_DATA {
22361 fn default() -> Self {
22362 Self::DEFAULT.clone()
22363 }
22364}
22365impl MessageData for PARAM_EXT_REQUEST_READ_DATA {
22366 type Message = MavMessage;
22367 const ID: u32 = 320u32;
22368 const NAME: &'static str = "PARAM_EXT_REQUEST_READ";
22369 const EXTRA_CRC: u8 = 243u8;
22370 const ENCODED_LEN: usize = 20usize;
22371 fn deser(
22372 _version: MavlinkVersion,
22373 __input: &[u8],
22374 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22375 let avail_len = __input.len();
22376 let mut payload_buf = [0; Self::ENCODED_LEN];
22377 let mut buf = if avail_len < Self::ENCODED_LEN {
22378 payload_buf[0..avail_len].copy_from_slice(__input);
22379 Bytes::new(&payload_buf)
22380 } else {
22381 Bytes::new(__input)
22382 };
22383 let mut __struct = Self::default();
22384 __struct.param_index = buf.get_i16_le();
22385 __struct.target_system = buf.get_u8();
22386 __struct.target_component = buf.get_u8();
22387 for v in &mut __struct.param_id {
22388 let val = buf.get_u8();
22389 *v = val;
22390 }
22391 Ok(__struct)
22392 }
22393 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22394 let mut __tmp = BytesMut::new(bytes);
22395 #[allow(clippy::absurd_extreme_comparisons)]
22396 #[allow(unused_comparisons)]
22397 if __tmp.remaining() < Self::ENCODED_LEN {
22398 panic!(
22399 "buffer is too small (need {} bytes, but got {})",
22400 Self::ENCODED_LEN,
22401 __tmp.remaining(),
22402 )
22403 }
22404 __tmp.put_i16_le(self.param_index);
22405 __tmp.put_u8(self.target_system);
22406 __tmp.put_u8(self.target_component);
22407 for val in &self.param_id {
22408 __tmp.put_u8(*val);
22409 }
22410 if matches!(version, MavlinkVersion::V2) {
22411 let len = __tmp.len();
22412 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22413 } else {
22414 __tmp.len()
22415 }
22416 }
22417}
22418#[doc = "id: 323"]
22419#[doc = "Set a parameter value. In order to deal with message loss (and retransmission of PARAM_EXT_SET), when setting a parameter value and the new value is the same as the current value, you will immediately get a PARAM_ACK_ACCEPTED response. If the current state is PARAM_ACK_IN_PROGRESS, you will accordingly receive a PARAM_ACK_IN_PROGRESS in response."]
22420#[derive(Debug, Clone, PartialEq)]
22421#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22422#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22423pub struct PARAM_EXT_SET_DATA {
22424 #[doc = "System ID"]
22425 pub target_system: u8,
22426 #[doc = "Component ID"]
22427 pub target_component: u8,
22428 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
22429 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22430 pub param_id: [u8; 16],
22431 #[doc = "Parameter value"]
22432 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22433 pub param_value: [u8; 128],
22434 #[doc = "Parameter type."]
22435 pub param_type: MavParamExtType,
22436}
22437impl PARAM_EXT_SET_DATA {
22438 pub const ENCODED_LEN: usize = 147usize;
22439 pub const DEFAULT: Self = Self {
22440 target_system: 0_u8,
22441 target_component: 0_u8,
22442 param_id: [0_u8; 16usize],
22443 param_value: [0_u8; 128usize],
22444 param_type: MavParamExtType::DEFAULT,
22445 };
22446 #[cfg(feature = "arbitrary")]
22447 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22448 use arbitrary::{Arbitrary, Unstructured};
22449 let mut buf = [0u8; 1024];
22450 rng.fill_bytes(&mut buf);
22451 let mut unstructured = Unstructured::new(&buf);
22452 Self::arbitrary(&mut unstructured).unwrap_or_default()
22453 }
22454}
22455impl Default for PARAM_EXT_SET_DATA {
22456 fn default() -> Self {
22457 Self::DEFAULT.clone()
22458 }
22459}
22460impl MessageData for PARAM_EXT_SET_DATA {
22461 type Message = MavMessage;
22462 const ID: u32 = 323u32;
22463 const NAME: &'static str = "PARAM_EXT_SET";
22464 const EXTRA_CRC: u8 = 78u8;
22465 const ENCODED_LEN: usize = 147usize;
22466 fn deser(
22467 _version: MavlinkVersion,
22468 __input: &[u8],
22469 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22470 let avail_len = __input.len();
22471 let mut payload_buf = [0; Self::ENCODED_LEN];
22472 let mut buf = if avail_len < Self::ENCODED_LEN {
22473 payload_buf[0..avail_len].copy_from_slice(__input);
22474 Bytes::new(&payload_buf)
22475 } else {
22476 Bytes::new(__input)
22477 };
22478 let mut __struct = Self::default();
22479 __struct.target_system = buf.get_u8();
22480 __struct.target_component = buf.get_u8();
22481 for v in &mut __struct.param_id {
22482 let val = buf.get_u8();
22483 *v = val;
22484 }
22485 for v in &mut __struct.param_value {
22486 let val = buf.get_u8();
22487 *v = val;
22488 }
22489 let tmp = buf.get_u8();
22490 __struct.param_type =
22491 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22492 enum_type: "MavParamExtType",
22493 value: tmp as u32,
22494 })?;
22495 Ok(__struct)
22496 }
22497 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22498 let mut __tmp = BytesMut::new(bytes);
22499 #[allow(clippy::absurd_extreme_comparisons)]
22500 #[allow(unused_comparisons)]
22501 if __tmp.remaining() < Self::ENCODED_LEN {
22502 panic!(
22503 "buffer is too small (need {} bytes, but got {})",
22504 Self::ENCODED_LEN,
22505 __tmp.remaining(),
22506 )
22507 }
22508 __tmp.put_u8(self.target_system);
22509 __tmp.put_u8(self.target_component);
22510 for val in &self.param_id {
22511 __tmp.put_u8(*val);
22512 }
22513 for val in &self.param_value {
22514 __tmp.put_u8(*val);
22515 }
22516 __tmp.put_u8(self.param_type as u8);
22517 if matches!(version, MavlinkVersion::V2) {
22518 let len = __tmp.len();
22519 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22520 } else {
22521 __tmp.len()
22522 }
22523 }
22524}
22525#[doc = "id: 322"]
22526#[doc = "Emit the value of a parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows them to re-request missing parameters after a loss or timeout."]
22527#[derive(Debug, Clone, PartialEq)]
22528#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22529#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22530pub struct PARAM_EXT_VALUE_DATA {
22531 #[doc = "Total number of parameters"]
22532 pub param_count: u16,
22533 #[doc = "Index of this parameter"]
22534 pub param_index: u16,
22535 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
22536 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22537 pub param_id: [u8; 16],
22538 #[doc = "Parameter value"]
22539 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22540 pub param_value: [u8; 128],
22541 #[doc = "Parameter type."]
22542 pub param_type: MavParamExtType,
22543}
22544impl PARAM_EXT_VALUE_DATA {
22545 pub const ENCODED_LEN: usize = 149usize;
22546 pub const DEFAULT: Self = Self {
22547 param_count: 0_u16,
22548 param_index: 0_u16,
22549 param_id: [0_u8; 16usize],
22550 param_value: [0_u8; 128usize],
22551 param_type: MavParamExtType::DEFAULT,
22552 };
22553 #[cfg(feature = "arbitrary")]
22554 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22555 use arbitrary::{Arbitrary, Unstructured};
22556 let mut buf = [0u8; 1024];
22557 rng.fill_bytes(&mut buf);
22558 let mut unstructured = Unstructured::new(&buf);
22559 Self::arbitrary(&mut unstructured).unwrap_or_default()
22560 }
22561}
22562impl Default for PARAM_EXT_VALUE_DATA {
22563 fn default() -> Self {
22564 Self::DEFAULT.clone()
22565 }
22566}
22567impl MessageData for PARAM_EXT_VALUE_DATA {
22568 type Message = MavMessage;
22569 const ID: u32 = 322u32;
22570 const NAME: &'static str = "PARAM_EXT_VALUE";
22571 const EXTRA_CRC: u8 = 243u8;
22572 const ENCODED_LEN: usize = 149usize;
22573 fn deser(
22574 _version: MavlinkVersion,
22575 __input: &[u8],
22576 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22577 let avail_len = __input.len();
22578 let mut payload_buf = [0; Self::ENCODED_LEN];
22579 let mut buf = if avail_len < Self::ENCODED_LEN {
22580 payload_buf[0..avail_len].copy_from_slice(__input);
22581 Bytes::new(&payload_buf)
22582 } else {
22583 Bytes::new(__input)
22584 };
22585 let mut __struct = Self::default();
22586 __struct.param_count = buf.get_u16_le();
22587 __struct.param_index = buf.get_u16_le();
22588 for v in &mut __struct.param_id {
22589 let val = buf.get_u8();
22590 *v = val;
22591 }
22592 for v in &mut __struct.param_value {
22593 let val = buf.get_u8();
22594 *v = val;
22595 }
22596 let tmp = buf.get_u8();
22597 __struct.param_type =
22598 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22599 enum_type: "MavParamExtType",
22600 value: tmp as u32,
22601 })?;
22602 Ok(__struct)
22603 }
22604 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22605 let mut __tmp = BytesMut::new(bytes);
22606 #[allow(clippy::absurd_extreme_comparisons)]
22607 #[allow(unused_comparisons)]
22608 if __tmp.remaining() < Self::ENCODED_LEN {
22609 panic!(
22610 "buffer is too small (need {} bytes, but got {})",
22611 Self::ENCODED_LEN,
22612 __tmp.remaining(),
22613 )
22614 }
22615 __tmp.put_u16_le(self.param_count);
22616 __tmp.put_u16_le(self.param_index);
22617 for val in &self.param_id {
22618 __tmp.put_u8(*val);
22619 }
22620 for val in &self.param_value {
22621 __tmp.put_u8(*val);
22622 }
22623 __tmp.put_u8(self.param_type as u8);
22624 if matches!(version, MavlinkVersion::V2) {
22625 let len = __tmp.len();
22626 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22627 } else {
22628 __tmp.len()
22629 }
22630 }
22631}
22632#[doc = "id: 50"]
22633#[doc = "Bind a RC channel to a parameter. The parameter should change according to the RC channel value."]
22634#[derive(Debug, Clone, PartialEq)]
22635#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22636#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22637pub struct PARAM_MAP_RC_DATA {
22638 #[doc = "Initial parameter value"]
22639 pub param_value0: f32,
22640 #[doc = "Scale, maps the RC range [-1, 1] to a parameter value"]
22641 pub scale: f32,
22642 #[doc = "Minimum param value. The protocol does not define if this overwrites an onboard minimum value. (Depends on implementation)"]
22643 pub param_value_min: f32,
22644 #[doc = "Maximum param value. The protocol does not define if this overwrites an onboard maximum value. (Depends on implementation)"]
22645 pub param_value_max: f32,
22646 #[doc = "Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored), send -2 to disable any existing map for this rc_channel_index."]
22647 pub param_index: i16,
22648 #[doc = "System ID"]
22649 pub target_system: u8,
22650 #[doc = "Component ID"]
22651 pub target_component: u8,
22652 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
22653 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22654 pub param_id: [u8; 16],
22655 #[doc = "Index of parameter RC channel. Not equal to the RC channel id. Typically corresponds to a potentiometer-knob on the RC."]
22656 pub parameter_rc_channel_index: u8,
22657}
22658impl PARAM_MAP_RC_DATA {
22659 pub const ENCODED_LEN: usize = 37usize;
22660 pub const DEFAULT: Self = Self {
22661 param_value0: 0.0_f32,
22662 scale: 0.0_f32,
22663 param_value_min: 0.0_f32,
22664 param_value_max: 0.0_f32,
22665 param_index: 0_i16,
22666 target_system: 0_u8,
22667 target_component: 0_u8,
22668 param_id: [0_u8; 16usize],
22669 parameter_rc_channel_index: 0_u8,
22670 };
22671 #[cfg(feature = "arbitrary")]
22672 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22673 use arbitrary::{Arbitrary, Unstructured};
22674 let mut buf = [0u8; 1024];
22675 rng.fill_bytes(&mut buf);
22676 let mut unstructured = Unstructured::new(&buf);
22677 Self::arbitrary(&mut unstructured).unwrap_or_default()
22678 }
22679}
22680impl Default for PARAM_MAP_RC_DATA {
22681 fn default() -> Self {
22682 Self::DEFAULT.clone()
22683 }
22684}
22685impl MessageData for PARAM_MAP_RC_DATA {
22686 type Message = MavMessage;
22687 const ID: u32 = 50u32;
22688 const NAME: &'static str = "PARAM_MAP_RC";
22689 const EXTRA_CRC: u8 = 78u8;
22690 const ENCODED_LEN: usize = 37usize;
22691 fn deser(
22692 _version: MavlinkVersion,
22693 __input: &[u8],
22694 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22695 let avail_len = __input.len();
22696 let mut payload_buf = [0; Self::ENCODED_LEN];
22697 let mut buf = if avail_len < Self::ENCODED_LEN {
22698 payload_buf[0..avail_len].copy_from_slice(__input);
22699 Bytes::new(&payload_buf)
22700 } else {
22701 Bytes::new(__input)
22702 };
22703 let mut __struct = Self::default();
22704 __struct.param_value0 = buf.get_f32_le();
22705 __struct.scale = buf.get_f32_le();
22706 __struct.param_value_min = buf.get_f32_le();
22707 __struct.param_value_max = buf.get_f32_le();
22708 __struct.param_index = buf.get_i16_le();
22709 __struct.target_system = buf.get_u8();
22710 __struct.target_component = buf.get_u8();
22711 for v in &mut __struct.param_id {
22712 let val = buf.get_u8();
22713 *v = val;
22714 }
22715 __struct.parameter_rc_channel_index = buf.get_u8();
22716 Ok(__struct)
22717 }
22718 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22719 let mut __tmp = BytesMut::new(bytes);
22720 #[allow(clippy::absurd_extreme_comparisons)]
22721 #[allow(unused_comparisons)]
22722 if __tmp.remaining() < Self::ENCODED_LEN {
22723 panic!(
22724 "buffer is too small (need {} bytes, but got {})",
22725 Self::ENCODED_LEN,
22726 __tmp.remaining(),
22727 )
22728 }
22729 __tmp.put_f32_le(self.param_value0);
22730 __tmp.put_f32_le(self.scale);
22731 __tmp.put_f32_le(self.param_value_min);
22732 __tmp.put_f32_le(self.param_value_max);
22733 __tmp.put_i16_le(self.param_index);
22734 __tmp.put_u8(self.target_system);
22735 __tmp.put_u8(self.target_component);
22736 for val in &self.param_id {
22737 __tmp.put_u8(*val);
22738 }
22739 __tmp.put_u8(self.parameter_rc_channel_index);
22740 if matches!(version, MavlinkVersion::V2) {
22741 let len = __tmp.len();
22742 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22743 } else {
22744 __tmp.len()
22745 }
22746 }
22747}
22748#[doc = "id: 21"]
22749#[doc = "Request all parameters of this component. After this request, all parameters are emitted. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
22750#[derive(Debug, Clone, PartialEq)]
22751#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22752#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22753pub struct PARAM_REQUEST_LIST_DATA {
22754 #[doc = "System ID"]
22755 pub target_system: u8,
22756 #[doc = "Component ID"]
22757 pub target_component: u8,
22758}
22759impl PARAM_REQUEST_LIST_DATA {
22760 pub const ENCODED_LEN: usize = 2usize;
22761 pub const DEFAULT: Self = Self {
22762 target_system: 0_u8,
22763 target_component: 0_u8,
22764 };
22765 #[cfg(feature = "arbitrary")]
22766 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22767 use arbitrary::{Arbitrary, Unstructured};
22768 let mut buf = [0u8; 1024];
22769 rng.fill_bytes(&mut buf);
22770 let mut unstructured = Unstructured::new(&buf);
22771 Self::arbitrary(&mut unstructured).unwrap_or_default()
22772 }
22773}
22774impl Default for PARAM_REQUEST_LIST_DATA {
22775 fn default() -> Self {
22776 Self::DEFAULT.clone()
22777 }
22778}
22779impl MessageData for PARAM_REQUEST_LIST_DATA {
22780 type Message = MavMessage;
22781 const ID: u32 = 21u32;
22782 const NAME: &'static str = "PARAM_REQUEST_LIST";
22783 const EXTRA_CRC: u8 = 159u8;
22784 const ENCODED_LEN: usize = 2usize;
22785 fn deser(
22786 _version: MavlinkVersion,
22787 __input: &[u8],
22788 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22789 let avail_len = __input.len();
22790 let mut payload_buf = [0; Self::ENCODED_LEN];
22791 let mut buf = if avail_len < Self::ENCODED_LEN {
22792 payload_buf[0..avail_len].copy_from_slice(__input);
22793 Bytes::new(&payload_buf)
22794 } else {
22795 Bytes::new(__input)
22796 };
22797 let mut __struct = Self::default();
22798 __struct.target_system = buf.get_u8();
22799 __struct.target_component = buf.get_u8();
22800 Ok(__struct)
22801 }
22802 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22803 let mut __tmp = BytesMut::new(bytes);
22804 #[allow(clippy::absurd_extreme_comparisons)]
22805 #[allow(unused_comparisons)]
22806 if __tmp.remaining() < Self::ENCODED_LEN {
22807 panic!(
22808 "buffer is too small (need {} bytes, but got {})",
22809 Self::ENCODED_LEN,
22810 __tmp.remaining(),
22811 )
22812 }
22813 __tmp.put_u8(self.target_system);
22814 __tmp.put_u8(self.target_component);
22815 if matches!(version, MavlinkVersion::V2) {
22816 let len = __tmp.len();
22817 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22818 } else {
22819 __tmp.len()
22820 }
22821 }
22822}
22823#[doc = "id: 20"]
22824#[doc = "value[float]. This allows to send a parameter to any other component (such as the GCS) without the need of previous knowledge of possible parameter names. Thus the same GCS can store different parameters for different autopilots. See also <https://mavlink.io/en/services/parameter.html> for a full documentation of QGroundControl and IMU code."]
22825#[derive(Debug, Clone, PartialEq)]
22826#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22827#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22828pub struct PARAM_REQUEST_READ_DATA {
22829 #[doc = "Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored)"]
22830 pub param_index: i16,
22831 #[doc = "System ID"]
22832 pub target_system: u8,
22833 #[doc = "Component ID"]
22834 pub target_component: u8,
22835 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
22836 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22837 pub param_id: [u8; 16],
22838}
22839impl PARAM_REQUEST_READ_DATA {
22840 pub const ENCODED_LEN: usize = 20usize;
22841 pub const DEFAULT: Self = Self {
22842 param_index: 0_i16,
22843 target_system: 0_u8,
22844 target_component: 0_u8,
22845 param_id: [0_u8; 16usize],
22846 };
22847 #[cfg(feature = "arbitrary")]
22848 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22849 use arbitrary::{Arbitrary, Unstructured};
22850 let mut buf = [0u8; 1024];
22851 rng.fill_bytes(&mut buf);
22852 let mut unstructured = Unstructured::new(&buf);
22853 Self::arbitrary(&mut unstructured).unwrap_or_default()
22854 }
22855}
22856impl Default for PARAM_REQUEST_READ_DATA {
22857 fn default() -> Self {
22858 Self::DEFAULT.clone()
22859 }
22860}
22861impl MessageData for PARAM_REQUEST_READ_DATA {
22862 type Message = MavMessage;
22863 const ID: u32 = 20u32;
22864 const NAME: &'static str = "PARAM_REQUEST_READ";
22865 const EXTRA_CRC: u8 = 214u8;
22866 const ENCODED_LEN: usize = 20usize;
22867 fn deser(
22868 _version: MavlinkVersion,
22869 __input: &[u8],
22870 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22871 let avail_len = __input.len();
22872 let mut payload_buf = [0; Self::ENCODED_LEN];
22873 let mut buf = if avail_len < Self::ENCODED_LEN {
22874 payload_buf[0..avail_len].copy_from_slice(__input);
22875 Bytes::new(&payload_buf)
22876 } else {
22877 Bytes::new(__input)
22878 };
22879 let mut __struct = Self::default();
22880 __struct.param_index = buf.get_i16_le();
22881 __struct.target_system = buf.get_u8();
22882 __struct.target_component = buf.get_u8();
22883 for v in &mut __struct.param_id {
22884 let val = buf.get_u8();
22885 *v = val;
22886 }
22887 Ok(__struct)
22888 }
22889 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22890 let mut __tmp = BytesMut::new(bytes);
22891 #[allow(clippy::absurd_extreme_comparisons)]
22892 #[allow(unused_comparisons)]
22893 if __tmp.remaining() < Self::ENCODED_LEN {
22894 panic!(
22895 "buffer is too small (need {} bytes, but got {})",
22896 Self::ENCODED_LEN,
22897 __tmp.remaining(),
22898 )
22899 }
22900 __tmp.put_i16_le(self.param_index);
22901 __tmp.put_u8(self.target_system);
22902 __tmp.put_u8(self.target_component);
22903 for val in &self.param_id {
22904 __tmp.put_u8(*val);
22905 }
22906 if matches!(version, MavlinkVersion::V2) {
22907 let len = __tmp.len();
22908 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22909 } else {
22910 __tmp.len()
22911 }
22912 }
22913}
22914#[doc = "id: 23"]
22915#[doc = "Set a parameter value (write new value to permanent storage). The receiving component should acknowledge the new parameter value by broadcasting a PARAM_VALUE message (broadcasting ensures that multiple GCS all have an up-to-date list of all parameters). If the sending GCS did not receive a PARAM_VALUE within its timeout time, it should re-send the PARAM_SET message. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
22916#[derive(Debug, Clone, PartialEq)]
22917#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22918#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22919pub struct PARAM_SET_DATA {
22920 #[doc = "Onboard parameter value"]
22921 pub param_value: f32,
22922 #[doc = "System ID"]
22923 pub target_system: u8,
22924 #[doc = "Component ID"]
22925 pub target_component: u8,
22926 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
22927 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22928 pub param_id: [u8; 16],
22929 #[doc = "Onboard parameter type."]
22930 pub param_type: MavParamType,
22931}
22932impl PARAM_SET_DATA {
22933 pub const ENCODED_LEN: usize = 23usize;
22934 pub const DEFAULT: Self = Self {
22935 param_value: 0.0_f32,
22936 target_system: 0_u8,
22937 target_component: 0_u8,
22938 param_id: [0_u8; 16usize],
22939 param_type: MavParamType::DEFAULT,
22940 };
22941 #[cfg(feature = "arbitrary")]
22942 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22943 use arbitrary::{Arbitrary, Unstructured};
22944 let mut buf = [0u8; 1024];
22945 rng.fill_bytes(&mut buf);
22946 let mut unstructured = Unstructured::new(&buf);
22947 Self::arbitrary(&mut unstructured).unwrap_or_default()
22948 }
22949}
22950impl Default for PARAM_SET_DATA {
22951 fn default() -> Self {
22952 Self::DEFAULT.clone()
22953 }
22954}
22955impl MessageData for PARAM_SET_DATA {
22956 type Message = MavMessage;
22957 const ID: u32 = 23u32;
22958 const NAME: &'static str = "PARAM_SET";
22959 const EXTRA_CRC: u8 = 168u8;
22960 const ENCODED_LEN: usize = 23usize;
22961 fn deser(
22962 _version: MavlinkVersion,
22963 __input: &[u8],
22964 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22965 let avail_len = __input.len();
22966 let mut payload_buf = [0; Self::ENCODED_LEN];
22967 let mut buf = if avail_len < Self::ENCODED_LEN {
22968 payload_buf[0..avail_len].copy_from_slice(__input);
22969 Bytes::new(&payload_buf)
22970 } else {
22971 Bytes::new(__input)
22972 };
22973 let mut __struct = Self::default();
22974 __struct.param_value = buf.get_f32_le();
22975 __struct.target_system = buf.get_u8();
22976 __struct.target_component = buf.get_u8();
22977 for v in &mut __struct.param_id {
22978 let val = buf.get_u8();
22979 *v = val;
22980 }
22981 let tmp = buf.get_u8();
22982 __struct.param_type =
22983 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22984 enum_type: "MavParamType",
22985 value: tmp as u32,
22986 })?;
22987 Ok(__struct)
22988 }
22989 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22990 let mut __tmp = BytesMut::new(bytes);
22991 #[allow(clippy::absurd_extreme_comparisons)]
22992 #[allow(unused_comparisons)]
22993 if __tmp.remaining() < Self::ENCODED_LEN {
22994 panic!(
22995 "buffer is too small (need {} bytes, but got {})",
22996 Self::ENCODED_LEN,
22997 __tmp.remaining(),
22998 )
22999 }
23000 __tmp.put_f32_le(self.param_value);
23001 __tmp.put_u8(self.target_system);
23002 __tmp.put_u8(self.target_component);
23003 for val in &self.param_id {
23004 __tmp.put_u8(*val);
23005 }
23006 __tmp.put_u8(self.param_type as u8);
23007 if matches!(version, MavlinkVersion::V2) {
23008 let len = __tmp.len();
23009 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23010 } else {
23011 __tmp.len()
23012 }
23013 }
23014}
23015#[doc = "id: 22"]
23016#[doc = "Emit the value of a onboard parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows him to re-request missing parameters after a loss or timeout. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
23017#[derive(Debug, Clone, PartialEq)]
23018#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23019#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23020pub struct PARAM_VALUE_DATA {
23021 #[doc = "Onboard parameter value"]
23022 pub param_value: f32,
23023 #[doc = "Total number of onboard parameters"]
23024 pub param_count: u16,
23025 #[doc = "Index of this onboard parameter"]
23026 pub param_index: u16,
23027 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
23028 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23029 pub param_id: [u8; 16],
23030 #[doc = "Onboard parameter type."]
23031 pub param_type: MavParamType,
23032}
23033impl PARAM_VALUE_DATA {
23034 pub const ENCODED_LEN: usize = 25usize;
23035 pub const DEFAULT: Self = Self {
23036 param_value: 0.0_f32,
23037 param_count: 0_u16,
23038 param_index: 0_u16,
23039 param_id: [0_u8; 16usize],
23040 param_type: MavParamType::DEFAULT,
23041 };
23042 #[cfg(feature = "arbitrary")]
23043 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23044 use arbitrary::{Arbitrary, Unstructured};
23045 let mut buf = [0u8; 1024];
23046 rng.fill_bytes(&mut buf);
23047 let mut unstructured = Unstructured::new(&buf);
23048 Self::arbitrary(&mut unstructured).unwrap_or_default()
23049 }
23050}
23051impl Default for PARAM_VALUE_DATA {
23052 fn default() -> Self {
23053 Self::DEFAULT.clone()
23054 }
23055}
23056impl MessageData for PARAM_VALUE_DATA {
23057 type Message = MavMessage;
23058 const ID: u32 = 22u32;
23059 const NAME: &'static str = "PARAM_VALUE";
23060 const EXTRA_CRC: u8 = 220u8;
23061 const ENCODED_LEN: usize = 25usize;
23062 fn deser(
23063 _version: MavlinkVersion,
23064 __input: &[u8],
23065 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23066 let avail_len = __input.len();
23067 let mut payload_buf = [0; Self::ENCODED_LEN];
23068 let mut buf = if avail_len < Self::ENCODED_LEN {
23069 payload_buf[0..avail_len].copy_from_slice(__input);
23070 Bytes::new(&payload_buf)
23071 } else {
23072 Bytes::new(__input)
23073 };
23074 let mut __struct = Self::default();
23075 __struct.param_value = buf.get_f32_le();
23076 __struct.param_count = buf.get_u16_le();
23077 __struct.param_index = buf.get_u16_le();
23078 for v in &mut __struct.param_id {
23079 let val = buf.get_u8();
23080 *v = val;
23081 }
23082 let tmp = buf.get_u8();
23083 __struct.param_type =
23084 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23085 enum_type: "MavParamType",
23086 value: tmp as u32,
23087 })?;
23088 Ok(__struct)
23089 }
23090 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23091 let mut __tmp = BytesMut::new(bytes);
23092 #[allow(clippy::absurd_extreme_comparisons)]
23093 #[allow(unused_comparisons)]
23094 if __tmp.remaining() < Self::ENCODED_LEN {
23095 panic!(
23096 "buffer is too small (need {} bytes, but got {})",
23097 Self::ENCODED_LEN,
23098 __tmp.remaining(),
23099 )
23100 }
23101 __tmp.put_f32_le(self.param_value);
23102 __tmp.put_u16_le(self.param_count);
23103 __tmp.put_u16_le(self.param_index);
23104 for val in &self.param_id {
23105 __tmp.put_u8(*val);
23106 }
23107 __tmp.put_u8(self.param_type as u8);
23108 if matches!(version, MavlinkVersion::V2) {
23109 let len = __tmp.len();
23110 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23111 } else {
23112 __tmp.len()
23113 }
23114 }
23115}
23116#[deprecated = "To be removed / merged with TIMESYNC. See `TIMESYNC` (Deprecated since 2011-08)"]
23117#[doc = "id: 4"]
23118#[doc = "A ping message either requesting or responding to a ping. This allows to measure the system latencies, including serial port, radio modem and UDP connections. The ping microservice is documented at <https://mavlink.io/en/services/ping.html>."]
23119#[derive(Debug, Clone, PartialEq)]
23120#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23121#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23122pub struct PING_DATA {
23123 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
23124 pub time_usec: u64,
23125 #[doc = "PING sequence"]
23126 pub seq: u32,
23127 #[doc = "0: request ping from all receiving systems. If greater than 0: message is a ping response and number is the system id of the requesting system"]
23128 pub target_system: u8,
23129 #[doc = "0: request ping from all receiving components. If greater than 0: message is a ping response and number is the component id of the requesting component."]
23130 pub target_component: u8,
23131}
23132impl PING_DATA {
23133 pub const ENCODED_LEN: usize = 14usize;
23134 pub const DEFAULT: Self = Self {
23135 time_usec: 0_u64,
23136 seq: 0_u32,
23137 target_system: 0_u8,
23138 target_component: 0_u8,
23139 };
23140 #[cfg(feature = "arbitrary")]
23141 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23142 use arbitrary::{Arbitrary, Unstructured};
23143 let mut buf = [0u8; 1024];
23144 rng.fill_bytes(&mut buf);
23145 let mut unstructured = Unstructured::new(&buf);
23146 Self::arbitrary(&mut unstructured).unwrap_or_default()
23147 }
23148}
23149impl Default for PING_DATA {
23150 fn default() -> Self {
23151 Self::DEFAULT.clone()
23152 }
23153}
23154impl MessageData for PING_DATA {
23155 type Message = MavMessage;
23156 const ID: u32 = 4u32;
23157 const NAME: &'static str = "PING";
23158 const EXTRA_CRC: u8 = 237u8;
23159 const ENCODED_LEN: usize = 14usize;
23160 fn deser(
23161 _version: MavlinkVersion,
23162 __input: &[u8],
23163 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23164 let avail_len = __input.len();
23165 let mut payload_buf = [0; Self::ENCODED_LEN];
23166 let mut buf = if avail_len < Self::ENCODED_LEN {
23167 payload_buf[0..avail_len].copy_from_slice(__input);
23168 Bytes::new(&payload_buf)
23169 } else {
23170 Bytes::new(__input)
23171 };
23172 let mut __struct = Self::default();
23173 __struct.time_usec = buf.get_u64_le();
23174 __struct.seq = buf.get_u32_le();
23175 __struct.target_system = buf.get_u8();
23176 __struct.target_component = buf.get_u8();
23177 Ok(__struct)
23178 }
23179 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23180 let mut __tmp = BytesMut::new(bytes);
23181 #[allow(clippy::absurd_extreme_comparisons)]
23182 #[allow(unused_comparisons)]
23183 if __tmp.remaining() < Self::ENCODED_LEN {
23184 panic!(
23185 "buffer is too small (need {} bytes, but got {})",
23186 Self::ENCODED_LEN,
23187 __tmp.remaining(),
23188 )
23189 }
23190 __tmp.put_u64_le(self.time_usec);
23191 __tmp.put_u32_le(self.seq);
23192 __tmp.put_u8(self.target_system);
23193 __tmp.put_u8(self.target_component);
23194 if matches!(version, MavlinkVersion::V2) {
23195 let len = __tmp.len();
23196 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23197 } else {
23198 __tmp.len()
23199 }
23200 }
23201}
23202#[deprecated = "New version explicitly defines format. More interoperable. See `PLAY_TUNE_V2` (Deprecated since 2019-10)"]
23203#[doc = "id: 258"]
23204#[doc = "Control vehicle tone generation (buzzer)."]
23205#[derive(Debug, Clone, PartialEq)]
23206#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23207#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23208pub struct PLAY_TUNE_DATA {
23209 #[doc = "System ID"]
23210 pub target_system: u8,
23211 #[doc = "Component ID"]
23212 pub target_component: u8,
23213 #[doc = "tune in board specific format"]
23214 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23215 pub tune: [u8; 30],
23216 #[doc = "tune extension (appended to tune)"]
23217 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
23218 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23219 pub tune2: [u8; 200],
23220}
23221impl PLAY_TUNE_DATA {
23222 pub const ENCODED_LEN: usize = 232usize;
23223 pub const DEFAULT: Self = Self {
23224 target_system: 0_u8,
23225 target_component: 0_u8,
23226 tune: [0_u8; 30usize],
23227 tune2: [0_u8; 200usize],
23228 };
23229 #[cfg(feature = "arbitrary")]
23230 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23231 use arbitrary::{Arbitrary, Unstructured};
23232 let mut buf = [0u8; 1024];
23233 rng.fill_bytes(&mut buf);
23234 let mut unstructured = Unstructured::new(&buf);
23235 Self::arbitrary(&mut unstructured).unwrap_or_default()
23236 }
23237}
23238impl Default for PLAY_TUNE_DATA {
23239 fn default() -> Self {
23240 Self::DEFAULT.clone()
23241 }
23242}
23243impl MessageData for PLAY_TUNE_DATA {
23244 type Message = MavMessage;
23245 const ID: u32 = 258u32;
23246 const NAME: &'static str = "PLAY_TUNE";
23247 const EXTRA_CRC: u8 = 187u8;
23248 const ENCODED_LEN: usize = 232usize;
23249 fn deser(
23250 _version: MavlinkVersion,
23251 __input: &[u8],
23252 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23253 let avail_len = __input.len();
23254 let mut payload_buf = [0; Self::ENCODED_LEN];
23255 let mut buf = if avail_len < Self::ENCODED_LEN {
23256 payload_buf[0..avail_len].copy_from_slice(__input);
23257 Bytes::new(&payload_buf)
23258 } else {
23259 Bytes::new(__input)
23260 };
23261 let mut __struct = Self::default();
23262 __struct.target_system = buf.get_u8();
23263 __struct.target_component = buf.get_u8();
23264 for v in &mut __struct.tune {
23265 let val = buf.get_u8();
23266 *v = val;
23267 }
23268 for v in &mut __struct.tune2 {
23269 let val = buf.get_u8();
23270 *v = val;
23271 }
23272 Ok(__struct)
23273 }
23274 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23275 let mut __tmp = BytesMut::new(bytes);
23276 #[allow(clippy::absurd_extreme_comparisons)]
23277 #[allow(unused_comparisons)]
23278 if __tmp.remaining() < Self::ENCODED_LEN {
23279 panic!(
23280 "buffer is too small (need {} bytes, but got {})",
23281 Self::ENCODED_LEN,
23282 __tmp.remaining(),
23283 )
23284 }
23285 __tmp.put_u8(self.target_system);
23286 __tmp.put_u8(self.target_component);
23287 for val in &self.tune {
23288 __tmp.put_u8(*val);
23289 }
23290 for val in &self.tune2 {
23291 __tmp.put_u8(*val);
23292 }
23293 if matches!(version, MavlinkVersion::V2) {
23294 let len = __tmp.len();
23295 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23296 } else {
23297 __tmp.len()
23298 }
23299 }
23300}
23301#[doc = "id: 400"]
23302#[doc = "Play vehicle tone/tune (buzzer). Supersedes message PLAY_TUNE."]
23303#[derive(Debug, Clone, PartialEq)]
23304#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23305#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23306pub struct PLAY_TUNE_V2_DATA {
23307 #[doc = "Tune format"]
23308 pub format: TuneFormat,
23309 #[doc = "System ID"]
23310 pub target_system: u8,
23311 #[doc = "Component ID"]
23312 pub target_component: u8,
23313 #[doc = "Tune definition as a NULL-terminated string."]
23314 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23315 pub tune: [u8; 248],
23316}
23317impl PLAY_TUNE_V2_DATA {
23318 pub const ENCODED_LEN: usize = 254usize;
23319 pub const DEFAULT: Self = Self {
23320 format: TuneFormat::DEFAULT,
23321 target_system: 0_u8,
23322 target_component: 0_u8,
23323 tune: [0_u8; 248usize],
23324 };
23325 #[cfg(feature = "arbitrary")]
23326 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23327 use arbitrary::{Arbitrary, Unstructured};
23328 let mut buf = [0u8; 1024];
23329 rng.fill_bytes(&mut buf);
23330 let mut unstructured = Unstructured::new(&buf);
23331 Self::arbitrary(&mut unstructured).unwrap_or_default()
23332 }
23333}
23334impl Default for PLAY_TUNE_V2_DATA {
23335 fn default() -> Self {
23336 Self::DEFAULT.clone()
23337 }
23338}
23339impl MessageData for PLAY_TUNE_V2_DATA {
23340 type Message = MavMessage;
23341 const ID: u32 = 400u32;
23342 const NAME: &'static str = "PLAY_TUNE_V2";
23343 const EXTRA_CRC: u8 = 110u8;
23344 const ENCODED_LEN: usize = 254usize;
23345 fn deser(
23346 _version: MavlinkVersion,
23347 __input: &[u8],
23348 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23349 let avail_len = __input.len();
23350 let mut payload_buf = [0; Self::ENCODED_LEN];
23351 let mut buf = if avail_len < Self::ENCODED_LEN {
23352 payload_buf[0..avail_len].copy_from_slice(__input);
23353 Bytes::new(&payload_buf)
23354 } else {
23355 Bytes::new(__input)
23356 };
23357 let mut __struct = Self::default();
23358 let tmp = buf.get_u32_le();
23359 __struct.format = FromPrimitive::from_u32(tmp).ok_or(
23360 ::mavlink_core::error::ParserError::InvalidEnum {
23361 enum_type: "TuneFormat",
23362 value: tmp as u32,
23363 },
23364 )?;
23365 __struct.target_system = buf.get_u8();
23366 __struct.target_component = buf.get_u8();
23367 for v in &mut __struct.tune {
23368 let val = buf.get_u8();
23369 *v = val;
23370 }
23371 Ok(__struct)
23372 }
23373 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23374 let mut __tmp = BytesMut::new(bytes);
23375 #[allow(clippy::absurd_extreme_comparisons)]
23376 #[allow(unused_comparisons)]
23377 if __tmp.remaining() < Self::ENCODED_LEN {
23378 panic!(
23379 "buffer is too small (need {} bytes, but got {})",
23380 Self::ENCODED_LEN,
23381 __tmp.remaining(),
23382 )
23383 }
23384 __tmp.put_u32_le(self.format as u32);
23385 __tmp.put_u8(self.target_system);
23386 __tmp.put_u8(self.target_component);
23387 for val in &self.tune {
23388 __tmp.put_u8(*val);
23389 }
23390 if matches!(version, MavlinkVersion::V2) {
23391 let len = __tmp.len();
23392 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23393 } else {
23394 __tmp.len()
23395 }
23396 }
23397}
23398#[doc = "id: 87"]
23399#[doc = "Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_GLOBAL_INT if the vehicle is being controlled this way."]
23400#[derive(Debug, Clone, PartialEq)]
23401#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23402#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23403pub struct POSITION_TARGET_GLOBAL_INT_DATA {
23404 #[doc = "Timestamp (time since system boot). The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency."]
23405 pub time_boot_ms: u32,
23406 #[doc = "Latitude in WGS84 frame"]
23407 pub lat_int: i32,
23408 #[doc = "Longitude in WGS84 frame"]
23409 pub lon_int: i32,
23410 #[doc = "Altitude (MSL, AGL or relative to home altitude, depending on frame)"]
23411 pub alt: f32,
23412 #[doc = "X velocity in NED frame"]
23413 pub vx: f32,
23414 #[doc = "Y velocity in NED frame"]
23415 pub vy: f32,
23416 #[doc = "Z velocity in NED frame"]
23417 pub vz: f32,
23418 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
23419 pub afx: f32,
23420 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
23421 pub afy: f32,
23422 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
23423 pub afz: f32,
23424 #[doc = "yaw setpoint"]
23425 pub yaw: f32,
23426 #[doc = "yaw rate setpoint"]
23427 pub yaw_rate: f32,
23428 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
23429 pub type_mask: PositionTargetTypemask,
23430 #[doc = "Valid options are: MAV_FRAME_GLOBAL = 0, MAV_FRAME_GLOBAL_RELATIVE_ALT = 3, MAV_FRAME_GLOBAL_TERRAIN_ALT = 10 (MAV_FRAME_GLOBAL_INT, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT are allowed synonyms, but have been deprecated)"]
23431 pub coordinate_frame: MavFrame,
23432}
23433impl POSITION_TARGET_GLOBAL_INT_DATA {
23434 pub const ENCODED_LEN: usize = 51usize;
23435 pub const DEFAULT: Self = Self {
23436 time_boot_ms: 0_u32,
23437 lat_int: 0_i32,
23438 lon_int: 0_i32,
23439 alt: 0.0_f32,
23440 vx: 0.0_f32,
23441 vy: 0.0_f32,
23442 vz: 0.0_f32,
23443 afx: 0.0_f32,
23444 afy: 0.0_f32,
23445 afz: 0.0_f32,
23446 yaw: 0.0_f32,
23447 yaw_rate: 0.0_f32,
23448 type_mask: PositionTargetTypemask::DEFAULT,
23449 coordinate_frame: MavFrame::DEFAULT,
23450 };
23451 #[cfg(feature = "arbitrary")]
23452 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23453 use arbitrary::{Arbitrary, Unstructured};
23454 let mut buf = [0u8; 1024];
23455 rng.fill_bytes(&mut buf);
23456 let mut unstructured = Unstructured::new(&buf);
23457 Self::arbitrary(&mut unstructured).unwrap_or_default()
23458 }
23459}
23460impl Default for POSITION_TARGET_GLOBAL_INT_DATA {
23461 fn default() -> Self {
23462 Self::DEFAULT.clone()
23463 }
23464}
23465impl MessageData for POSITION_TARGET_GLOBAL_INT_DATA {
23466 type Message = MavMessage;
23467 const ID: u32 = 87u32;
23468 const NAME: &'static str = "POSITION_TARGET_GLOBAL_INT";
23469 const EXTRA_CRC: u8 = 150u8;
23470 const ENCODED_LEN: usize = 51usize;
23471 fn deser(
23472 _version: MavlinkVersion,
23473 __input: &[u8],
23474 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23475 let avail_len = __input.len();
23476 let mut payload_buf = [0; Self::ENCODED_LEN];
23477 let mut buf = if avail_len < Self::ENCODED_LEN {
23478 payload_buf[0..avail_len].copy_from_slice(__input);
23479 Bytes::new(&payload_buf)
23480 } else {
23481 Bytes::new(__input)
23482 };
23483 let mut __struct = Self::default();
23484 __struct.time_boot_ms = buf.get_u32_le();
23485 __struct.lat_int = buf.get_i32_le();
23486 __struct.lon_int = buf.get_i32_le();
23487 __struct.alt = buf.get_f32_le();
23488 __struct.vx = buf.get_f32_le();
23489 __struct.vy = buf.get_f32_le();
23490 __struct.vz = buf.get_f32_le();
23491 __struct.afx = buf.get_f32_le();
23492 __struct.afy = buf.get_f32_le();
23493 __struct.afz = buf.get_f32_le();
23494 __struct.yaw = buf.get_f32_le();
23495 __struct.yaw_rate = buf.get_f32_le();
23496 let tmp = buf.get_u16_le();
23497 __struct.type_mask = PositionTargetTypemask::from_bits(
23498 tmp & PositionTargetTypemask::all().bits(),
23499 )
23500 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
23501 flag_type: "PositionTargetTypemask",
23502 value: tmp as u32,
23503 })?;
23504 let tmp = buf.get_u8();
23505 __struct.coordinate_frame =
23506 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23507 enum_type: "MavFrame",
23508 value: tmp as u32,
23509 })?;
23510 Ok(__struct)
23511 }
23512 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23513 let mut __tmp = BytesMut::new(bytes);
23514 #[allow(clippy::absurd_extreme_comparisons)]
23515 #[allow(unused_comparisons)]
23516 if __tmp.remaining() < Self::ENCODED_LEN {
23517 panic!(
23518 "buffer is too small (need {} bytes, but got {})",
23519 Self::ENCODED_LEN,
23520 __tmp.remaining(),
23521 )
23522 }
23523 __tmp.put_u32_le(self.time_boot_ms);
23524 __tmp.put_i32_le(self.lat_int);
23525 __tmp.put_i32_le(self.lon_int);
23526 __tmp.put_f32_le(self.alt);
23527 __tmp.put_f32_le(self.vx);
23528 __tmp.put_f32_le(self.vy);
23529 __tmp.put_f32_le(self.vz);
23530 __tmp.put_f32_le(self.afx);
23531 __tmp.put_f32_le(self.afy);
23532 __tmp.put_f32_le(self.afz);
23533 __tmp.put_f32_le(self.yaw);
23534 __tmp.put_f32_le(self.yaw_rate);
23535 __tmp.put_u16_le(self.type_mask.bits());
23536 __tmp.put_u8(self.coordinate_frame as u8);
23537 if matches!(version, MavlinkVersion::V2) {
23538 let len = __tmp.len();
23539 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23540 } else {
23541 __tmp.len()
23542 }
23543 }
23544}
23545#[doc = "id: 85"]
23546#[doc = "Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_LOCAL_NED if the vehicle is being controlled this way."]
23547#[derive(Debug, Clone, PartialEq)]
23548#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23549#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23550pub struct POSITION_TARGET_LOCAL_NED_DATA {
23551 #[doc = "Timestamp (time since system boot)."]
23552 pub time_boot_ms: u32,
23553 #[doc = "X Position in NED frame"]
23554 pub x: f32,
23555 #[doc = "Y Position in NED frame"]
23556 pub y: f32,
23557 #[doc = "Z Position in NED frame (note, altitude is negative in NED)"]
23558 pub z: f32,
23559 #[doc = "X velocity in NED frame"]
23560 pub vx: f32,
23561 #[doc = "Y velocity in NED frame"]
23562 pub vy: f32,
23563 #[doc = "Z velocity in NED frame"]
23564 pub vz: f32,
23565 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
23566 pub afx: f32,
23567 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
23568 pub afy: f32,
23569 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
23570 pub afz: f32,
23571 #[doc = "yaw setpoint"]
23572 pub yaw: f32,
23573 #[doc = "yaw rate setpoint"]
23574 pub yaw_rate: f32,
23575 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
23576 pub type_mask: PositionTargetTypemask,
23577 #[doc = "Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9"]
23578 pub coordinate_frame: MavFrame,
23579}
23580impl POSITION_TARGET_LOCAL_NED_DATA {
23581 pub const ENCODED_LEN: usize = 51usize;
23582 pub const DEFAULT: Self = Self {
23583 time_boot_ms: 0_u32,
23584 x: 0.0_f32,
23585 y: 0.0_f32,
23586 z: 0.0_f32,
23587 vx: 0.0_f32,
23588 vy: 0.0_f32,
23589 vz: 0.0_f32,
23590 afx: 0.0_f32,
23591 afy: 0.0_f32,
23592 afz: 0.0_f32,
23593 yaw: 0.0_f32,
23594 yaw_rate: 0.0_f32,
23595 type_mask: PositionTargetTypemask::DEFAULT,
23596 coordinate_frame: MavFrame::DEFAULT,
23597 };
23598 #[cfg(feature = "arbitrary")]
23599 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23600 use arbitrary::{Arbitrary, Unstructured};
23601 let mut buf = [0u8; 1024];
23602 rng.fill_bytes(&mut buf);
23603 let mut unstructured = Unstructured::new(&buf);
23604 Self::arbitrary(&mut unstructured).unwrap_or_default()
23605 }
23606}
23607impl Default for POSITION_TARGET_LOCAL_NED_DATA {
23608 fn default() -> Self {
23609 Self::DEFAULT.clone()
23610 }
23611}
23612impl MessageData for POSITION_TARGET_LOCAL_NED_DATA {
23613 type Message = MavMessage;
23614 const ID: u32 = 85u32;
23615 const NAME: &'static str = "POSITION_TARGET_LOCAL_NED";
23616 const EXTRA_CRC: u8 = 140u8;
23617 const ENCODED_LEN: usize = 51usize;
23618 fn deser(
23619 _version: MavlinkVersion,
23620 __input: &[u8],
23621 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23622 let avail_len = __input.len();
23623 let mut payload_buf = [0; Self::ENCODED_LEN];
23624 let mut buf = if avail_len < Self::ENCODED_LEN {
23625 payload_buf[0..avail_len].copy_from_slice(__input);
23626 Bytes::new(&payload_buf)
23627 } else {
23628 Bytes::new(__input)
23629 };
23630 let mut __struct = Self::default();
23631 __struct.time_boot_ms = buf.get_u32_le();
23632 __struct.x = buf.get_f32_le();
23633 __struct.y = buf.get_f32_le();
23634 __struct.z = buf.get_f32_le();
23635 __struct.vx = buf.get_f32_le();
23636 __struct.vy = buf.get_f32_le();
23637 __struct.vz = buf.get_f32_le();
23638 __struct.afx = buf.get_f32_le();
23639 __struct.afy = buf.get_f32_le();
23640 __struct.afz = buf.get_f32_le();
23641 __struct.yaw = buf.get_f32_le();
23642 __struct.yaw_rate = buf.get_f32_le();
23643 let tmp = buf.get_u16_le();
23644 __struct.type_mask = PositionTargetTypemask::from_bits(
23645 tmp & PositionTargetTypemask::all().bits(),
23646 )
23647 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
23648 flag_type: "PositionTargetTypemask",
23649 value: tmp as u32,
23650 })?;
23651 let tmp = buf.get_u8();
23652 __struct.coordinate_frame =
23653 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23654 enum_type: "MavFrame",
23655 value: tmp as u32,
23656 })?;
23657 Ok(__struct)
23658 }
23659 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23660 let mut __tmp = BytesMut::new(bytes);
23661 #[allow(clippy::absurd_extreme_comparisons)]
23662 #[allow(unused_comparisons)]
23663 if __tmp.remaining() < Self::ENCODED_LEN {
23664 panic!(
23665 "buffer is too small (need {} bytes, but got {})",
23666 Self::ENCODED_LEN,
23667 __tmp.remaining(),
23668 )
23669 }
23670 __tmp.put_u32_le(self.time_boot_ms);
23671 __tmp.put_f32_le(self.x);
23672 __tmp.put_f32_le(self.y);
23673 __tmp.put_f32_le(self.z);
23674 __tmp.put_f32_le(self.vx);
23675 __tmp.put_f32_le(self.vy);
23676 __tmp.put_f32_le(self.vz);
23677 __tmp.put_f32_le(self.afx);
23678 __tmp.put_f32_le(self.afy);
23679 __tmp.put_f32_le(self.afz);
23680 __tmp.put_f32_le(self.yaw);
23681 __tmp.put_f32_le(self.yaw_rate);
23682 __tmp.put_u16_le(self.type_mask.bits());
23683 __tmp.put_u8(self.coordinate_frame as u8);
23684 if matches!(version, MavlinkVersion::V2) {
23685 let len = __tmp.len();
23686 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23687 } else {
23688 __tmp.len()
23689 }
23690 }
23691}
23692#[doc = "id: 125"]
23693#[doc = "Power supply status."]
23694#[derive(Debug, Clone, PartialEq)]
23695#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23696#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23697pub struct POWER_STATUS_DATA {
23698 #[doc = "5V rail voltage."]
23699 pub Vcc: u16,
23700 #[doc = "Servo rail voltage."]
23701 pub Vservo: u16,
23702 #[doc = "Bitmap of power supply status flags."]
23703 pub flags: MavPowerStatus,
23704}
23705impl POWER_STATUS_DATA {
23706 pub const ENCODED_LEN: usize = 6usize;
23707 pub const DEFAULT: Self = Self {
23708 Vcc: 0_u16,
23709 Vservo: 0_u16,
23710 flags: MavPowerStatus::DEFAULT,
23711 };
23712 #[cfg(feature = "arbitrary")]
23713 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23714 use arbitrary::{Arbitrary, Unstructured};
23715 let mut buf = [0u8; 1024];
23716 rng.fill_bytes(&mut buf);
23717 let mut unstructured = Unstructured::new(&buf);
23718 Self::arbitrary(&mut unstructured).unwrap_or_default()
23719 }
23720}
23721impl Default for POWER_STATUS_DATA {
23722 fn default() -> Self {
23723 Self::DEFAULT.clone()
23724 }
23725}
23726impl MessageData for POWER_STATUS_DATA {
23727 type Message = MavMessage;
23728 const ID: u32 = 125u32;
23729 const NAME: &'static str = "POWER_STATUS";
23730 const EXTRA_CRC: u8 = 203u8;
23731 const ENCODED_LEN: usize = 6usize;
23732 fn deser(
23733 _version: MavlinkVersion,
23734 __input: &[u8],
23735 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23736 let avail_len = __input.len();
23737 let mut payload_buf = [0; Self::ENCODED_LEN];
23738 let mut buf = if avail_len < Self::ENCODED_LEN {
23739 payload_buf[0..avail_len].copy_from_slice(__input);
23740 Bytes::new(&payload_buf)
23741 } else {
23742 Bytes::new(__input)
23743 };
23744 let mut __struct = Self::default();
23745 __struct.Vcc = buf.get_u16_le();
23746 __struct.Vservo = buf.get_u16_le();
23747 let tmp = buf.get_u16_le();
23748 __struct.flags = MavPowerStatus::from_bits(tmp & MavPowerStatus::all().bits()).ok_or(
23749 ::mavlink_core::error::ParserError::InvalidFlag {
23750 flag_type: "MavPowerStatus",
23751 value: tmp as u32,
23752 },
23753 )?;
23754 Ok(__struct)
23755 }
23756 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23757 let mut __tmp = BytesMut::new(bytes);
23758 #[allow(clippy::absurd_extreme_comparisons)]
23759 #[allow(unused_comparisons)]
23760 if __tmp.remaining() < Self::ENCODED_LEN {
23761 panic!(
23762 "buffer is too small (need {} bytes, but got {})",
23763 Self::ENCODED_LEN,
23764 __tmp.remaining(),
23765 )
23766 }
23767 __tmp.put_u16_le(self.Vcc);
23768 __tmp.put_u16_le(self.Vservo);
23769 __tmp.put_u16_le(self.flags.bits());
23770 if matches!(version, MavlinkVersion::V2) {
23771 let len = __tmp.len();
23772 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23773 } else {
23774 __tmp.len()
23775 }
23776 }
23777}
23778#[doc = "id: 300"]
23779#[doc = "Version and capability of protocol version. This message can be requested with MAV_CMD_REQUEST_MESSAGE and is used as part of the handshaking to establish which MAVLink version should be used on the network. Every node should respond to a request for PROTOCOL_VERSION to enable the handshaking. Library implementers should consider adding this into the default decoding state machine to allow the protocol core to respond directly."]
23780#[derive(Debug, Clone, PartialEq)]
23781#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23782#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23783pub struct PROTOCOL_VERSION_DATA {
23784 #[doc = "Currently active MAVLink version number * 100: v1.0 is 100, v2.0 is 200, etc."]
23785 pub version: u16,
23786 #[doc = "Minimum MAVLink version supported"]
23787 pub min_version: u16,
23788 #[doc = "Maximum MAVLink version supported (set to the same value as version by default)"]
23789 pub max_version: u16,
23790 #[doc = "The first 8 bytes (not characters printed in hex!) of the git hash."]
23791 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23792 pub spec_version_hash: [u8; 8],
23793 #[doc = "The first 8 bytes (not characters printed in hex!) of the git hash."]
23794 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23795 pub library_version_hash: [u8; 8],
23796}
23797impl PROTOCOL_VERSION_DATA {
23798 pub const ENCODED_LEN: usize = 22usize;
23799 pub const DEFAULT: Self = Self {
23800 version: 0_u16,
23801 min_version: 0_u16,
23802 max_version: 0_u16,
23803 spec_version_hash: [0_u8; 8usize],
23804 library_version_hash: [0_u8; 8usize],
23805 };
23806 #[cfg(feature = "arbitrary")]
23807 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23808 use arbitrary::{Arbitrary, Unstructured};
23809 let mut buf = [0u8; 1024];
23810 rng.fill_bytes(&mut buf);
23811 let mut unstructured = Unstructured::new(&buf);
23812 Self::arbitrary(&mut unstructured).unwrap_or_default()
23813 }
23814}
23815impl Default for PROTOCOL_VERSION_DATA {
23816 fn default() -> Self {
23817 Self::DEFAULT.clone()
23818 }
23819}
23820impl MessageData for PROTOCOL_VERSION_DATA {
23821 type Message = MavMessage;
23822 const ID: u32 = 300u32;
23823 const NAME: &'static str = "PROTOCOL_VERSION";
23824 const EXTRA_CRC: u8 = 217u8;
23825 const ENCODED_LEN: usize = 22usize;
23826 fn deser(
23827 _version: MavlinkVersion,
23828 __input: &[u8],
23829 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23830 let avail_len = __input.len();
23831 let mut payload_buf = [0; Self::ENCODED_LEN];
23832 let mut buf = if avail_len < Self::ENCODED_LEN {
23833 payload_buf[0..avail_len].copy_from_slice(__input);
23834 Bytes::new(&payload_buf)
23835 } else {
23836 Bytes::new(__input)
23837 };
23838 let mut __struct = Self::default();
23839 __struct.version = buf.get_u16_le();
23840 __struct.min_version = buf.get_u16_le();
23841 __struct.max_version = buf.get_u16_le();
23842 for v in &mut __struct.spec_version_hash {
23843 let val = buf.get_u8();
23844 *v = val;
23845 }
23846 for v in &mut __struct.library_version_hash {
23847 let val = buf.get_u8();
23848 *v = val;
23849 }
23850 Ok(__struct)
23851 }
23852 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23853 let mut __tmp = BytesMut::new(bytes);
23854 #[allow(clippy::absurd_extreme_comparisons)]
23855 #[allow(unused_comparisons)]
23856 if __tmp.remaining() < Self::ENCODED_LEN {
23857 panic!(
23858 "buffer is too small (need {} bytes, but got {})",
23859 Self::ENCODED_LEN,
23860 __tmp.remaining(),
23861 )
23862 }
23863 __tmp.put_u16_le(self.version);
23864 __tmp.put_u16_le(self.min_version);
23865 __tmp.put_u16_le(self.max_version);
23866 for val in &self.spec_version_hash {
23867 __tmp.put_u8(*val);
23868 }
23869 for val in &self.library_version_hash {
23870 __tmp.put_u8(*val);
23871 }
23872 if matches!(version, MavlinkVersion::V2) {
23873 let len = __tmp.len();
23874 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23875 } else {
23876 __tmp.len()
23877 }
23878 }
23879}
23880#[doc = "id: 109"]
23881#[doc = "Status generated by radio and injected into MAVLink stream."]
23882#[derive(Debug, Clone, PartialEq)]
23883#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23884#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23885pub struct RADIO_STATUS_DATA {
23886 #[doc = "Count of radio packet receive errors (since boot)."]
23887 pub rxerrors: u16,
23888 #[doc = "Count of error corrected radio packets (since boot)."]
23889 pub fixed: u16,
23890 #[doc = "Local (message sender) received signal strength indication in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
23891 pub rssi: u8,
23892 #[doc = "Remote (message receiver) signal strength indication in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
23893 pub remrssi: u8,
23894 #[doc = "Remaining free transmitter buffer space."]
23895 pub txbuf: u8,
23896 #[doc = "Local background noise level. These are device dependent RSSI values (scale as approx 2x dB on SiK radios). Values: [0-254], UINT8_MAX: invalid/unknown."]
23897 pub noise: u8,
23898 #[doc = "Remote background noise level. These are device dependent RSSI values (scale as approx 2x dB on SiK radios). Values: [0-254], UINT8_MAX: invalid/unknown."]
23899 pub remnoise: u8,
23900}
23901impl RADIO_STATUS_DATA {
23902 pub const ENCODED_LEN: usize = 9usize;
23903 pub const DEFAULT: Self = Self {
23904 rxerrors: 0_u16,
23905 fixed: 0_u16,
23906 rssi: 0_u8,
23907 remrssi: 0_u8,
23908 txbuf: 0_u8,
23909 noise: 0_u8,
23910 remnoise: 0_u8,
23911 };
23912 #[cfg(feature = "arbitrary")]
23913 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23914 use arbitrary::{Arbitrary, Unstructured};
23915 let mut buf = [0u8; 1024];
23916 rng.fill_bytes(&mut buf);
23917 let mut unstructured = Unstructured::new(&buf);
23918 Self::arbitrary(&mut unstructured).unwrap_or_default()
23919 }
23920}
23921impl Default for RADIO_STATUS_DATA {
23922 fn default() -> Self {
23923 Self::DEFAULT.clone()
23924 }
23925}
23926impl MessageData for RADIO_STATUS_DATA {
23927 type Message = MavMessage;
23928 const ID: u32 = 109u32;
23929 const NAME: &'static str = "RADIO_STATUS";
23930 const EXTRA_CRC: u8 = 185u8;
23931 const ENCODED_LEN: usize = 9usize;
23932 fn deser(
23933 _version: MavlinkVersion,
23934 __input: &[u8],
23935 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23936 let avail_len = __input.len();
23937 let mut payload_buf = [0; Self::ENCODED_LEN];
23938 let mut buf = if avail_len < Self::ENCODED_LEN {
23939 payload_buf[0..avail_len].copy_from_slice(__input);
23940 Bytes::new(&payload_buf)
23941 } else {
23942 Bytes::new(__input)
23943 };
23944 let mut __struct = Self::default();
23945 __struct.rxerrors = buf.get_u16_le();
23946 __struct.fixed = buf.get_u16_le();
23947 __struct.rssi = buf.get_u8();
23948 __struct.remrssi = buf.get_u8();
23949 __struct.txbuf = buf.get_u8();
23950 __struct.noise = buf.get_u8();
23951 __struct.remnoise = buf.get_u8();
23952 Ok(__struct)
23953 }
23954 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23955 let mut __tmp = BytesMut::new(bytes);
23956 #[allow(clippy::absurd_extreme_comparisons)]
23957 #[allow(unused_comparisons)]
23958 if __tmp.remaining() < Self::ENCODED_LEN {
23959 panic!(
23960 "buffer is too small (need {} bytes, but got {})",
23961 Self::ENCODED_LEN,
23962 __tmp.remaining(),
23963 )
23964 }
23965 __tmp.put_u16_le(self.rxerrors);
23966 __tmp.put_u16_le(self.fixed);
23967 __tmp.put_u8(self.rssi);
23968 __tmp.put_u8(self.remrssi);
23969 __tmp.put_u8(self.txbuf);
23970 __tmp.put_u8(self.noise);
23971 __tmp.put_u8(self.remnoise);
23972 if matches!(version, MavlinkVersion::V2) {
23973 let len = __tmp.len();
23974 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23975 } else {
23976 __tmp.len()
23977 }
23978 }
23979}
23980#[doc = "id: 27"]
23981#[doc = "The RAW IMU readings for a 9DOF sensor, which is identified by the id (default IMU1). This message should always contain the true raw values without any scaling to allow data capture and system debugging."]
23982#[derive(Debug, Clone, PartialEq)]
23983#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23984#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23985pub struct RAW_IMU_DATA {
23986 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
23987 pub time_usec: u64,
23988 #[doc = "X acceleration (raw)"]
23989 pub xacc: i16,
23990 #[doc = "Y acceleration (raw)"]
23991 pub yacc: i16,
23992 #[doc = "Z acceleration (raw)"]
23993 pub zacc: i16,
23994 #[doc = "Angular speed around X axis (raw)"]
23995 pub xgyro: i16,
23996 #[doc = "Angular speed around Y axis (raw)"]
23997 pub ygyro: i16,
23998 #[doc = "Angular speed around Z axis (raw)"]
23999 pub zgyro: i16,
24000 #[doc = "X Magnetic field (raw)"]
24001 pub xmag: i16,
24002 #[doc = "Y Magnetic field (raw)"]
24003 pub ymag: i16,
24004 #[doc = "Z Magnetic field (raw)"]
24005 pub zmag: i16,
24006 #[doc = "Id. Ids are numbered from 0 and map to IMUs numbered from 1 (e.g. IMU1 will have a message with id=0)"]
24007 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24008 pub id: u8,
24009 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
24010 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24011 pub temperature: i16,
24012}
24013impl RAW_IMU_DATA {
24014 pub const ENCODED_LEN: usize = 29usize;
24015 pub const DEFAULT: Self = Self {
24016 time_usec: 0_u64,
24017 xacc: 0_i16,
24018 yacc: 0_i16,
24019 zacc: 0_i16,
24020 xgyro: 0_i16,
24021 ygyro: 0_i16,
24022 zgyro: 0_i16,
24023 xmag: 0_i16,
24024 ymag: 0_i16,
24025 zmag: 0_i16,
24026 id: 0_u8,
24027 temperature: 0_i16,
24028 };
24029 #[cfg(feature = "arbitrary")]
24030 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24031 use arbitrary::{Arbitrary, Unstructured};
24032 let mut buf = [0u8; 1024];
24033 rng.fill_bytes(&mut buf);
24034 let mut unstructured = Unstructured::new(&buf);
24035 Self::arbitrary(&mut unstructured).unwrap_or_default()
24036 }
24037}
24038impl Default for RAW_IMU_DATA {
24039 fn default() -> Self {
24040 Self::DEFAULT.clone()
24041 }
24042}
24043impl MessageData for RAW_IMU_DATA {
24044 type Message = MavMessage;
24045 const ID: u32 = 27u32;
24046 const NAME: &'static str = "RAW_IMU";
24047 const EXTRA_CRC: u8 = 144u8;
24048 const ENCODED_LEN: usize = 29usize;
24049 fn deser(
24050 _version: MavlinkVersion,
24051 __input: &[u8],
24052 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24053 let avail_len = __input.len();
24054 let mut payload_buf = [0; Self::ENCODED_LEN];
24055 let mut buf = if avail_len < Self::ENCODED_LEN {
24056 payload_buf[0..avail_len].copy_from_slice(__input);
24057 Bytes::new(&payload_buf)
24058 } else {
24059 Bytes::new(__input)
24060 };
24061 let mut __struct = Self::default();
24062 __struct.time_usec = buf.get_u64_le();
24063 __struct.xacc = buf.get_i16_le();
24064 __struct.yacc = buf.get_i16_le();
24065 __struct.zacc = buf.get_i16_le();
24066 __struct.xgyro = buf.get_i16_le();
24067 __struct.ygyro = buf.get_i16_le();
24068 __struct.zgyro = buf.get_i16_le();
24069 __struct.xmag = buf.get_i16_le();
24070 __struct.ymag = buf.get_i16_le();
24071 __struct.zmag = buf.get_i16_le();
24072 __struct.id = buf.get_u8();
24073 __struct.temperature = buf.get_i16_le();
24074 Ok(__struct)
24075 }
24076 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24077 let mut __tmp = BytesMut::new(bytes);
24078 #[allow(clippy::absurd_extreme_comparisons)]
24079 #[allow(unused_comparisons)]
24080 if __tmp.remaining() < Self::ENCODED_LEN {
24081 panic!(
24082 "buffer is too small (need {} bytes, but got {})",
24083 Self::ENCODED_LEN,
24084 __tmp.remaining(),
24085 )
24086 }
24087 __tmp.put_u64_le(self.time_usec);
24088 __tmp.put_i16_le(self.xacc);
24089 __tmp.put_i16_le(self.yacc);
24090 __tmp.put_i16_le(self.zacc);
24091 __tmp.put_i16_le(self.xgyro);
24092 __tmp.put_i16_le(self.ygyro);
24093 __tmp.put_i16_le(self.zgyro);
24094 __tmp.put_i16_le(self.xmag);
24095 __tmp.put_i16_le(self.ymag);
24096 __tmp.put_i16_le(self.zmag);
24097 __tmp.put_u8(self.id);
24098 __tmp.put_i16_le(self.temperature);
24099 if matches!(version, MavlinkVersion::V2) {
24100 let len = __tmp.len();
24101 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24102 } else {
24103 __tmp.len()
24104 }
24105 }
24106}
24107#[doc = "id: 28"]
24108#[doc = "The RAW pressure readings for the typical setup of one absolute pressure and one differential pressure sensor. The sensor values should be the raw, UNSCALED ADC values."]
24109#[derive(Debug, Clone, PartialEq)]
24110#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24111#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24112pub struct RAW_PRESSURE_DATA {
24113 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
24114 pub time_usec: u64,
24115 #[doc = "Absolute pressure (raw)"]
24116 pub press_abs: i16,
24117 #[doc = "Differential pressure 1 (raw, 0 if nonexistent)"]
24118 pub press_diff1: i16,
24119 #[doc = "Differential pressure 2 (raw, 0 if nonexistent)"]
24120 pub press_diff2: i16,
24121 #[doc = "Raw Temperature measurement (raw)"]
24122 pub temperature: i16,
24123}
24124impl RAW_PRESSURE_DATA {
24125 pub const ENCODED_LEN: usize = 16usize;
24126 pub const DEFAULT: Self = Self {
24127 time_usec: 0_u64,
24128 press_abs: 0_i16,
24129 press_diff1: 0_i16,
24130 press_diff2: 0_i16,
24131 temperature: 0_i16,
24132 };
24133 #[cfg(feature = "arbitrary")]
24134 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24135 use arbitrary::{Arbitrary, Unstructured};
24136 let mut buf = [0u8; 1024];
24137 rng.fill_bytes(&mut buf);
24138 let mut unstructured = Unstructured::new(&buf);
24139 Self::arbitrary(&mut unstructured).unwrap_or_default()
24140 }
24141}
24142impl Default for RAW_PRESSURE_DATA {
24143 fn default() -> Self {
24144 Self::DEFAULT.clone()
24145 }
24146}
24147impl MessageData for RAW_PRESSURE_DATA {
24148 type Message = MavMessage;
24149 const ID: u32 = 28u32;
24150 const NAME: &'static str = "RAW_PRESSURE";
24151 const EXTRA_CRC: u8 = 67u8;
24152 const ENCODED_LEN: usize = 16usize;
24153 fn deser(
24154 _version: MavlinkVersion,
24155 __input: &[u8],
24156 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24157 let avail_len = __input.len();
24158 let mut payload_buf = [0; Self::ENCODED_LEN];
24159 let mut buf = if avail_len < Self::ENCODED_LEN {
24160 payload_buf[0..avail_len].copy_from_slice(__input);
24161 Bytes::new(&payload_buf)
24162 } else {
24163 Bytes::new(__input)
24164 };
24165 let mut __struct = Self::default();
24166 __struct.time_usec = buf.get_u64_le();
24167 __struct.press_abs = buf.get_i16_le();
24168 __struct.press_diff1 = buf.get_i16_le();
24169 __struct.press_diff2 = buf.get_i16_le();
24170 __struct.temperature = buf.get_i16_le();
24171 Ok(__struct)
24172 }
24173 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24174 let mut __tmp = BytesMut::new(bytes);
24175 #[allow(clippy::absurd_extreme_comparisons)]
24176 #[allow(unused_comparisons)]
24177 if __tmp.remaining() < Self::ENCODED_LEN {
24178 panic!(
24179 "buffer is too small (need {} bytes, but got {})",
24180 Self::ENCODED_LEN,
24181 __tmp.remaining(),
24182 )
24183 }
24184 __tmp.put_u64_le(self.time_usec);
24185 __tmp.put_i16_le(self.press_abs);
24186 __tmp.put_i16_le(self.press_diff1);
24187 __tmp.put_i16_le(self.press_diff2);
24188 __tmp.put_i16_le(self.temperature);
24189 if matches!(version, MavlinkVersion::V2) {
24190 let len = __tmp.len();
24191 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24192 } else {
24193 __tmp.len()
24194 }
24195 }
24196}
24197#[doc = "id: 339"]
24198#[doc = "RPM sensor data message."]
24199#[derive(Debug, Clone, PartialEq)]
24200#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24201#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24202pub struct RAW_RPM_DATA {
24203 #[doc = "Indicated rate"]
24204 pub frequency: f32,
24205 #[doc = "Index of this RPM sensor (0-indexed)"]
24206 pub index: u8,
24207}
24208impl RAW_RPM_DATA {
24209 pub const ENCODED_LEN: usize = 5usize;
24210 pub const DEFAULT: Self = Self {
24211 frequency: 0.0_f32,
24212 index: 0_u8,
24213 };
24214 #[cfg(feature = "arbitrary")]
24215 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24216 use arbitrary::{Arbitrary, Unstructured};
24217 let mut buf = [0u8; 1024];
24218 rng.fill_bytes(&mut buf);
24219 let mut unstructured = Unstructured::new(&buf);
24220 Self::arbitrary(&mut unstructured).unwrap_or_default()
24221 }
24222}
24223impl Default for RAW_RPM_DATA {
24224 fn default() -> Self {
24225 Self::DEFAULT.clone()
24226 }
24227}
24228impl MessageData for RAW_RPM_DATA {
24229 type Message = MavMessage;
24230 const ID: u32 = 339u32;
24231 const NAME: &'static str = "RAW_RPM";
24232 const EXTRA_CRC: u8 = 199u8;
24233 const ENCODED_LEN: usize = 5usize;
24234 fn deser(
24235 _version: MavlinkVersion,
24236 __input: &[u8],
24237 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24238 let avail_len = __input.len();
24239 let mut payload_buf = [0; Self::ENCODED_LEN];
24240 let mut buf = if avail_len < Self::ENCODED_LEN {
24241 payload_buf[0..avail_len].copy_from_slice(__input);
24242 Bytes::new(&payload_buf)
24243 } else {
24244 Bytes::new(__input)
24245 };
24246 let mut __struct = Self::default();
24247 __struct.frequency = buf.get_f32_le();
24248 __struct.index = buf.get_u8();
24249 Ok(__struct)
24250 }
24251 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24252 let mut __tmp = BytesMut::new(bytes);
24253 #[allow(clippy::absurd_extreme_comparisons)]
24254 #[allow(unused_comparisons)]
24255 if __tmp.remaining() < Self::ENCODED_LEN {
24256 panic!(
24257 "buffer is too small (need {} bytes, but got {})",
24258 Self::ENCODED_LEN,
24259 __tmp.remaining(),
24260 )
24261 }
24262 __tmp.put_f32_le(self.frequency);
24263 __tmp.put_u8(self.index);
24264 if matches!(version, MavlinkVersion::V2) {
24265 let len = __tmp.len();
24266 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24267 } else {
24268 __tmp.len()
24269 }
24270 }
24271}
24272#[doc = "id: 65"]
24273#[doc = "The PPM values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. A value of UINT16_MAX implies the channel is unused. Individual receivers/transmitters might violate this specification."]
24274#[derive(Debug, Clone, PartialEq)]
24275#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24276#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24277pub struct RC_CHANNELS_DATA {
24278 #[doc = "Timestamp (time since system boot)."]
24279 pub time_boot_ms: u32,
24280 #[doc = "RC channel 1 value."]
24281 pub chan1_raw: u16,
24282 #[doc = "RC channel 2 value."]
24283 pub chan2_raw: u16,
24284 #[doc = "RC channel 3 value."]
24285 pub chan3_raw: u16,
24286 #[doc = "RC channel 4 value."]
24287 pub chan4_raw: u16,
24288 #[doc = "RC channel 5 value."]
24289 pub chan5_raw: u16,
24290 #[doc = "RC channel 6 value."]
24291 pub chan6_raw: u16,
24292 #[doc = "RC channel 7 value."]
24293 pub chan7_raw: u16,
24294 #[doc = "RC channel 8 value."]
24295 pub chan8_raw: u16,
24296 #[doc = "RC channel 9 value."]
24297 pub chan9_raw: u16,
24298 #[doc = "RC channel 10 value."]
24299 pub chan10_raw: u16,
24300 #[doc = "RC channel 11 value."]
24301 pub chan11_raw: u16,
24302 #[doc = "RC channel 12 value."]
24303 pub chan12_raw: u16,
24304 #[doc = "RC channel 13 value."]
24305 pub chan13_raw: u16,
24306 #[doc = "RC channel 14 value."]
24307 pub chan14_raw: u16,
24308 #[doc = "RC channel 15 value."]
24309 pub chan15_raw: u16,
24310 #[doc = "RC channel 16 value."]
24311 pub chan16_raw: u16,
24312 #[doc = "RC channel 17 value."]
24313 pub chan17_raw: u16,
24314 #[doc = "RC channel 18 value."]
24315 pub chan18_raw: u16,
24316 #[doc = "Total number of RC channels being received. This can be larger than 18, indicating that more channels are available but not given in this message. This value should be 0 when no RC channels are available."]
24317 pub chancount: u8,
24318 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
24319 pub rssi: u8,
24320}
24321impl RC_CHANNELS_DATA {
24322 pub const ENCODED_LEN: usize = 42usize;
24323 pub const DEFAULT: Self = Self {
24324 time_boot_ms: 0_u32,
24325 chan1_raw: 0_u16,
24326 chan2_raw: 0_u16,
24327 chan3_raw: 0_u16,
24328 chan4_raw: 0_u16,
24329 chan5_raw: 0_u16,
24330 chan6_raw: 0_u16,
24331 chan7_raw: 0_u16,
24332 chan8_raw: 0_u16,
24333 chan9_raw: 0_u16,
24334 chan10_raw: 0_u16,
24335 chan11_raw: 0_u16,
24336 chan12_raw: 0_u16,
24337 chan13_raw: 0_u16,
24338 chan14_raw: 0_u16,
24339 chan15_raw: 0_u16,
24340 chan16_raw: 0_u16,
24341 chan17_raw: 0_u16,
24342 chan18_raw: 0_u16,
24343 chancount: 0_u8,
24344 rssi: 0_u8,
24345 };
24346 #[cfg(feature = "arbitrary")]
24347 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24348 use arbitrary::{Arbitrary, Unstructured};
24349 let mut buf = [0u8; 1024];
24350 rng.fill_bytes(&mut buf);
24351 let mut unstructured = Unstructured::new(&buf);
24352 Self::arbitrary(&mut unstructured).unwrap_or_default()
24353 }
24354}
24355impl Default for RC_CHANNELS_DATA {
24356 fn default() -> Self {
24357 Self::DEFAULT.clone()
24358 }
24359}
24360impl MessageData for RC_CHANNELS_DATA {
24361 type Message = MavMessage;
24362 const ID: u32 = 65u32;
24363 const NAME: &'static str = "RC_CHANNELS";
24364 const EXTRA_CRC: u8 = 118u8;
24365 const ENCODED_LEN: usize = 42usize;
24366 fn deser(
24367 _version: MavlinkVersion,
24368 __input: &[u8],
24369 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24370 let avail_len = __input.len();
24371 let mut payload_buf = [0; Self::ENCODED_LEN];
24372 let mut buf = if avail_len < Self::ENCODED_LEN {
24373 payload_buf[0..avail_len].copy_from_slice(__input);
24374 Bytes::new(&payload_buf)
24375 } else {
24376 Bytes::new(__input)
24377 };
24378 let mut __struct = Self::default();
24379 __struct.time_boot_ms = buf.get_u32_le();
24380 __struct.chan1_raw = buf.get_u16_le();
24381 __struct.chan2_raw = buf.get_u16_le();
24382 __struct.chan3_raw = buf.get_u16_le();
24383 __struct.chan4_raw = buf.get_u16_le();
24384 __struct.chan5_raw = buf.get_u16_le();
24385 __struct.chan6_raw = buf.get_u16_le();
24386 __struct.chan7_raw = buf.get_u16_le();
24387 __struct.chan8_raw = buf.get_u16_le();
24388 __struct.chan9_raw = buf.get_u16_le();
24389 __struct.chan10_raw = buf.get_u16_le();
24390 __struct.chan11_raw = buf.get_u16_le();
24391 __struct.chan12_raw = buf.get_u16_le();
24392 __struct.chan13_raw = buf.get_u16_le();
24393 __struct.chan14_raw = buf.get_u16_le();
24394 __struct.chan15_raw = buf.get_u16_le();
24395 __struct.chan16_raw = buf.get_u16_le();
24396 __struct.chan17_raw = buf.get_u16_le();
24397 __struct.chan18_raw = buf.get_u16_le();
24398 __struct.chancount = buf.get_u8();
24399 __struct.rssi = buf.get_u8();
24400 Ok(__struct)
24401 }
24402 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24403 let mut __tmp = BytesMut::new(bytes);
24404 #[allow(clippy::absurd_extreme_comparisons)]
24405 #[allow(unused_comparisons)]
24406 if __tmp.remaining() < Self::ENCODED_LEN {
24407 panic!(
24408 "buffer is too small (need {} bytes, but got {})",
24409 Self::ENCODED_LEN,
24410 __tmp.remaining(),
24411 )
24412 }
24413 __tmp.put_u32_le(self.time_boot_ms);
24414 __tmp.put_u16_le(self.chan1_raw);
24415 __tmp.put_u16_le(self.chan2_raw);
24416 __tmp.put_u16_le(self.chan3_raw);
24417 __tmp.put_u16_le(self.chan4_raw);
24418 __tmp.put_u16_le(self.chan5_raw);
24419 __tmp.put_u16_le(self.chan6_raw);
24420 __tmp.put_u16_le(self.chan7_raw);
24421 __tmp.put_u16_le(self.chan8_raw);
24422 __tmp.put_u16_le(self.chan9_raw);
24423 __tmp.put_u16_le(self.chan10_raw);
24424 __tmp.put_u16_le(self.chan11_raw);
24425 __tmp.put_u16_le(self.chan12_raw);
24426 __tmp.put_u16_le(self.chan13_raw);
24427 __tmp.put_u16_le(self.chan14_raw);
24428 __tmp.put_u16_le(self.chan15_raw);
24429 __tmp.put_u16_le(self.chan16_raw);
24430 __tmp.put_u16_le(self.chan17_raw);
24431 __tmp.put_u16_le(self.chan18_raw);
24432 __tmp.put_u8(self.chancount);
24433 __tmp.put_u8(self.rssi);
24434 if matches!(version, MavlinkVersion::V2) {
24435 let len = __tmp.len();
24436 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24437 } else {
24438 __tmp.len()
24439 }
24440 }
24441}
24442#[doc = "id: 70"]
24443#[doc = "The RAW values of the RC channels sent to the MAV to override info received from the RC radio. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification. Note carefully the semantic differences between the first 8 channels and the subsequent channels."]
24444#[derive(Debug, Clone, PartialEq)]
24445#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24446#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24447pub struct RC_CHANNELS_OVERRIDE_DATA {
24448 #[doc = "RC channel 1 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
24449 pub chan1_raw: u16,
24450 #[doc = "RC channel 2 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
24451 pub chan2_raw: u16,
24452 #[doc = "RC channel 3 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
24453 pub chan3_raw: u16,
24454 #[doc = "RC channel 4 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
24455 pub chan4_raw: u16,
24456 #[doc = "RC channel 5 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
24457 pub chan5_raw: u16,
24458 #[doc = "RC channel 6 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
24459 pub chan6_raw: u16,
24460 #[doc = "RC channel 7 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
24461 pub chan7_raw: u16,
24462 #[doc = "RC channel 8 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
24463 pub chan8_raw: u16,
24464 #[doc = "System ID"]
24465 pub target_system: u8,
24466 #[doc = "Component ID"]
24467 pub target_component: u8,
24468 #[doc = "RC channel 9 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
24469 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24470 pub chan9_raw: u16,
24471 #[doc = "RC channel 10 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
24472 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24473 pub chan10_raw: u16,
24474 #[doc = "RC channel 11 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
24475 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24476 pub chan11_raw: u16,
24477 #[doc = "RC channel 12 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
24478 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24479 pub chan12_raw: u16,
24480 #[doc = "RC channel 13 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
24481 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24482 pub chan13_raw: u16,
24483 #[doc = "RC channel 14 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
24484 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24485 pub chan14_raw: u16,
24486 #[doc = "RC channel 15 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
24487 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24488 pub chan15_raw: u16,
24489 #[doc = "RC channel 16 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
24490 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24491 pub chan16_raw: u16,
24492 #[doc = "RC channel 17 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
24493 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24494 pub chan17_raw: u16,
24495 #[doc = "RC channel 18 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
24496 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24497 pub chan18_raw: u16,
24498}
24499impl RC_CHANNELS_OVERRIDE_DATA {
24500 pub const ENCODED_LEN: usize = 38usize;
24501 pub const DEFAULT: Self = Self {
24502 chan1_raw: 0_u16,
24503 chan2_raw: 0_u16,
24504 chan3_raw: 0_u16,
24505 chan4_raw: 0_u16,
24506 chan5_raw: 0_u16,
24507 chan6_raw: 0_u16,
24508 chan7_raw: 0_u16,
24509 chan8_raw: 0_u16,
24510 target_system: 0_u8,
24511 target_component: 0_u8,
24512 chan9_raw: 0_u16,
24513 chan10_raw: 0_u16,
24514 chan11_raw: 0_u16,
24515 chan12_raw: 0_u16,
24516 chan13_raw: 0_u16,
24517 chan14_raw: 0_u16,
24518 chan15_raw: 0_u16,
24519 chan16_raw: 0_u16,
24520 chan17_raw: 0_u16,
24521 chan18_raw: 0_u16,
24522 };
24523 #[cfg(feature = "arbitrary")]
24524 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24525 use arbitrary::{Arbitrary, Unstructured};
24526 let mut buf = [0u8; 1024];
24527 rng.fill_bytes(&mut buf);
24528 let mut unstructured = Unstructured::new(&buf);
24529 Self::arbitrary(&mut unstructured).unwrap_or_default()
24530 }
24531}
24532impl Default for RC_CHANNELS_OVERRIDE_DATA {
24533 fn default() -> Self {
24534 Self::DEFAULT.clone()
24535 }
24536}
24537impl MessageData for RC_CHANNELS_OVERRIDE_DATA {
24538 type Message = MavMessage;
24539 const ID: u32 = 70u32;
24540 const NAME: &'static str = "RC_CHANNELS_OVERRIDE";
24541 const EXTRA_CRC: u8 = 124u8;
24542 const ENCODED_LEN: usize = 38usize;
24543 fn deser(
24544 _version: MavlinkVersion,
24545 __input: &[u8],
24546 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24547 let avail_len = __input.len();
24548 let mut payload_buf = [0; Self::ENCODED_LEN];
24549 let mut buf = if avail_len < Self::ENCODED_LEN {
24550 payload_buf[0..avail_len].copy_from_slice(__input);
24551 Bytes::new(&payload_buf)
24552 } else {
24553 Bytes::new(__input)
24554 };
24555 let mut __struct = Self::default();
24556 __struct.chan1_raw = buf.get_u16_le();
24557 __struct.chan2_raw = buf.get_u16_le();
24558 __struct.chan3_raw = buf.get_u16_le();
24559 __struct.chan4_raw = buf.get_u16_le();
24560 __struct.chan5_raw = buf.get_u16_le();
24561 __struct.chan6_raw = buf.get_u16_le();
24562 __struct.chan7_raw = buf.get_u16_le();
24563 __struct.chan8_raw = buf.get_u16_le();
24564 __struct.target_system = buf.get_u8();
24565 __struct.target_component = buf.get_u8();
24566 __struct.chan9_raw = buf.get_u16_le();
24567 __struct.chan10_raw = buf.get_u16_le();
24568 __struct.chan11_raw = buf.get_u16_le();
24569 __struct.chan12_raw = buf.get_u16_le();
24570 __struct.chan13_raw = buf.get_u16_le();
24571 __struct.chan14_raw = buf.get_u16_le();
24572 __struct.chan15_raw = buf.get_u16_le();
24573 __struct.chan16_raw = buf.get_u16_le();
24574 __struct.chan17_raw = buf.get_u16_le();
24575 __struct.chan18_raw = buf.get_u16_le();
24576 Ok(__struct)
24577 }
24578 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24579 let mut __tmp = BytesMut::new(bytes);
24580 #[allow(clippy::absurd_extreme_comparisons)]
24581 #[allow(unused_comparisons)]
24582 if __tmp.remaining() < Self::ENCODED_LEN {
24583 panic!(
24584 "buffer is too small (need {} bytes, but got {})",
24585 Self::ENCODED_LEN,
24586 __tmp.remaining(),
24587 )
24588 }
24589 __tmp.put_u16_le(self.chan1_raw);
24590 __tmp.put_u16_le(self.chan2_raw);
24591 __tmp.put_u16_le(self.chan3_raw);
24592 __tmp.put_u16_le(self.chan4_raw);
24593 __tmp.put_u16_le(self.chan5_raw);
24594 __tmp.put_u16_le(self.chan6_raw);
24595 __tmp.put_u16_le(self.chan7_raw);
24596 __tmp.put_u16_le(self.chan8_raw);
24597 __tmp.put_u8(self.target_system);
24598 __tmp.put_u8(self.target_component);
24599 __tmp.put_u16_le(self.chan9_raw);
24600 __tmp.put_u16_le(self.chan10_raw);
24601 __tmp.put_u16_le(self.chan11_raw);
24602 __tmp.put_u16_le(self.chan12_raw);
24603 __tmp.put_u16_le(self.chan13_raw);
24604 __tmp.put_u16_le(self.chan14_raw);
24605 __tmp.put_u16_le(self.chan15_raw);
24606 __tmp.put_u16_le(self.chan16_raw);
24607 __tmp.put_u16_le(self.chan17_raw);
24608 __tmp.put_u16_le(self.chan18_raw);
24609 if matches!(version, MavlinkVersion::V2) {
24610 let len = __tmp.len();
24611 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24612 } else {
24613 __tmp.len()
24614 }
24615 }
24616}
24617#[doc = "id: 35"]
24618#[doc = "The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. A value of UINT16_MAX implies the channel is unused. Individual receivers/transmitters might violate this specification."]
24619#[derive(Debug, Clone, PartialEq)]
24620#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24621#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24622pub struct RC_CHANNELS_RAW_DATA {
24623 #[doc = "Timestamp (time since system boot)."]
24624 pub time_boot_ms: u32,
24625 #[doc = "RC channel 1 value."]
24626 pub chan1_raw: u16,
24627 #[doc = "RC channel 2 value."]
24628 pub chan2_raw: u16,
24629 #[doc = "RC channel 3 value."]
24630 pub chan3_raw: u16,
24631 #[doc = "RC channel 4 value."]
24632 pub chan4_raw: u16,
24633 #[doc = "RC channel 5 value."]
24634 pub chan5_raw: u16,
24635 #[doc = "RC channel 6 value."]
24636 pub chan6_raw: u16,
24637 #[doc = "RC channel 7 value."]
24638 pub chan7_raw: u16,
24639 #[doc = "RC channel 8 value."]
24640 pub chan8_raw: u16,
24641 #[doc = "Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX."]
24642 pub port: u8,
24643 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
24644 pub rssi: u8,
24645}
24646impl RC_CHANNELS_RAW_DATA {
24647 pub const ENCODED_LEN: usize = 22usize;
24648 pub const DEFAULT: Self = Self {
24649 time_boot_ms: 0_u32,
24650 chan1_raw: 0_u16,
24651 chan2_raw: 0_u16,
24652 chan3_raw: 0_u16,
24653 chan4_raw: 0_u16,
24654 chan5_raw: 0_u16,
24655 chan6_raw: 0_u16,
24656 chan7_raw: 0_u16,
24657 chan8_raw: 0_u16,
24658 port: 0_u8,
24659 rssi: 0_u8,
24660 };
24661 #[cfg(feature = "arbitrary")]
24662 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24663 use arbitrary::{Arbitrary, Unstructured};
24664 let mut buf = [0u8; 1024];
24665 rng.fill_bytes(&mut buf);
24666 let mut unstructured = Unstructured::new(&buf);
24667 Self::arbitrary(&mut unstructured).unwrap_or_default()
24668 }
24669}
24670impl Default for RC_CHANNELS_RAW_DATA {
24671 fn default() -> Self {
24672 Self::DEFAULT.clone()
24673 }
24674}
24675impl MessageData for RC_CHANNELS_RAW_DATA {
24676 type Message = MavMessage;
24677 const ID: u32 = 35u32;
24678 const NAME: &'static str = "RC_CHANNELS_RAW";
24679 const EXTRA_CRC: u8 = 244u8;
24680 const ENCODED_LEN: usize = 22usize;
24681 fn deser(
24682 _version: MavlinkVersion,
24683 __input: &[u8],
24684 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24685 let avail_len = __input.len();
24686 let mut payload_buf = [0; Self::ENCODED_LEN];
24687 let mut buf = if avail_len < Self::ENCODED_LEN {
24688 payload_buf[0..avail_len].copy_from_slice(__input);
24689 Bytes::new(&payload_buf)
24690 } else {
24691 Bytes::new(__input)
24692 };
24693 let mut __struct = Self::default();
24694 __struct.time_boot_ms = buf.get_u32_le();
24695 __struct.chan1_raw = buf.get_u16_le();
24696 __struct.chan2_raw = buf.get_u16_le();
24697 __struct.chan3_raw = buf.get_u16_le();
24698 __struct.chan4_raw = buf.get_u16_le();
24699 __struct.chan5_raw = buf.get_u16_le();
24700 __struct.chan6_raw = buf.get_u16_le();
24701 __struct.chan7_raw = buf.get_u16_le();
24702 __struct.chan8_raw = buf.get_u16_le();
24703 __struct.port = buf.get_u8();
24704 __struct.rssi = buf.get_u8();
24705 Ok(__struct)
24706 }
24707 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24708 let mut __tmp = BytesMut::new(bytes);
24709 #[allow(clippy::absurd_extreme_comparisons)]
24710 #[allow(unused_comparisons)]
24711 if __tmp.remaining() < Self::ENCODED_LEN {
24712 panic!(
24713 "buffer is too small (need {} bytes, but got {})",
24714 Self::ENCODED_LEN,
24715 __tmp.remaining(),
24716 )
24717 }
24718 __tmp.put_u32_le(self.time_boot_ms);
24719 __tmp.put_u16_le(self.chan1_raw);
24720 __tmp.put_u16_le(self.chan2_raw);
24721 __tmp.put_u16_le(self.chan3_raw);
24722 __tmp.put_u16_le(self.chan4_raw);
24723 __tmp.put_u16_le(self.chan5_raw);
24724 __tmp.put_u16_le(self.chan6_raw);
24725 __tmp.put_u16_le(self.chan7_raw);
24726 __tmp.put_u16_le(self.chan8_raw);
24727 __tmp.put_u8(self.port);
24728 __tmp.put_u8(self.rssi);
24729 if matches!(version, MavlinkVersion::V2) {
24730 let len = __tmp.len();
24731 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24732 } else {
24733 __tmp.len()
24734 }
24735 }
24736}
24737#[doc = "id: 34"]
24738#[doc = "The scaled values of the RC channels received: (-100%) -10000, (0%) 0, (100%) 10000. Channels that are inactive should be set to INT16_MAX."]
24739#[derive(Debug, Clone, PartialEq)]
24740#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24741#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24742pub struct RC_CHANNELS_SCALED_DATA {
24743 #[doc = "Timestamp (time since system boot)."]
24744 pub time_boot_ms: u32,
24745 #[doc = "RC channel 1 value scaled."]
24746 pub chan1_scaled: i16,
24747 #[doc = "RC channel 2 value scaled."]
24748 pub chan2_scaled: i16,
24749 #[doc = "RC channel 3 value scaled."]
24750 pub chan3_scaled: i16,
24751 #[doc = "RC channel 4 value scaled."]
24752 pub chan4_scaled: i16,
24753 #[doc = "RC channel 5 value scaled."]
24754 pub chan5_scaled: i16,
24755 #[doc = "RC channel 6 value scaled."]
24756 pub chan6_scaled: i16,
24757 #[doc = "RC channel 7 value scaled."]
24758 pub chan7_scaled: i16,
24759 #[doc = "RC channel 8 value scaled."]
24760 pub chan8_scaled: i16,
24761 #[doc = "Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX."]
24762 pub port: u8,
24763 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
24764 pub rssi: u8,
24765}
24766impl RC_CHANNELS_SCALED_DATA {
24767 pub const ENCODED_LEN: usize = 22usize;
24768 pub const DEFAULT: Self = Self {
24769 time_boot_ms: 0_u32,
24770 chan1_scaled: 0_i16,
24771 chan2_scaled: 0_i16,
24772 chan3_scaled: 0_i16,
24773 chan4_scaled: 0_i16,
24774 chan5_scaled: 0_i16,
24775 chan6_scaled: 0_i16,
24776 chan7_scaled: 0_i16,
24777 chan8_scaled: 0_i16,
24778 port: 0_u8,
24779 rssi: 0_u8,
24780 };
24781 #[cfg(feature = "arbitrary")]
24782 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24783 use arbitrary::{Arbitrary, Unstructured};
24784 let mut buf = [0u8; 1024];
24785 rng.fill_bytes(&mut buf);
24786 let mut unstructured = Unstructured::new(&buf);
24787 Self::arbitrary(&mut unstructured).unwrap_or_default()
24788 }
24789}
24790impl Default for RC_CHANNELS_SCALED_DATA {
24791 fn default() -> Self {
24792 Self::DEFAULT.clone()
24793 }
24794}
24795impl MessageData for RC_CHANNELS_SCALED_DATA {
24796 type Message = MavMessage;
24797 const ID: u32 = 34u32;
24798 const NAME: &'static str = "RC_CHANNELS_SCALED";
24799 const EXTRA_CRC: u8 = 237u8;
24800 const ENCODED_LEN: usize = 22usize;
24801 fn deser(
24802 _version: MavlinkVersion,
24803 __input: &[u8],
24804 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24805 let avail_len = __input.len();
24806 let mut payload_buf = [0; Self::ENCODED_LEN];
24807 let mut buf = if avail_len < Self::ENCODED_LEN {
24808 payload_buf[0..avail_len].copy_from_slice(__input);
24809 Bytes::new(&payload_buf)
24810 } else {
24811 Bytes::new(__input)
24812 };
24813 let mut __struct = Self::default();
24814 __struct.time_boot_ms = buf.get_u32_le();
24815 __struct.chan1_scaled = buf.get_i16_le();
24816 __struct.chan2_scaled = buf.get_i16_le();
24817 __struct.chan3_scaled = buf.get_i16_le();
24818 __struct.chan4_scaled = buf.get_i16_le();
24819 __struct.chan5_scaled = buf.get_i16_le();
24820 __struct.chan6_scaled = buf.get_i16_le();
24821 __struct.chan7_scaled = buf.get_i16_le();
24822 __struct.chan8_scaled = buf.get_i16_le();
24823 __struct.port = buf.get_u8();
24824 __struct.rssi = buf.get_u8();
24825 Ok(__struct)
24826 }
24827 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24828 let mut __tmp = BytesMut::new(bytes);
24829 #[allow(clippy::absurd_extreme_comparisons)]
24830 #[allow(unused_comparisons)]
24831 if __tmp.remaining() < Self::ENCODED_LEN {
24832 panic!(
24833 "buffer is too small (need {} bytes, but got {})",
24834 Self::ENCODED_LEN,
24835 __tmp.remaining(),
24836 )
24837 }
24838 __tmp.put_u32_le(self.time_boot_ms);
24839 __tmp.put_i16_le(self.chan1_scaled);
24840 __tmp.put_i16_le(self.chan2_scaled);
24841 __tmp.put_i16_le(self.chan3_scaled);
24842 __tmp.put_i16_le(self.chan4_scaled);
24843 __tmp.put_i16_le(self.chan5_scaled);
24844 __tmp.put_i16_le(self.chan6_scaled);
24845 __tmp.put_i16_le(self.chan7_scaled);
24846 __tmp.put_i16_le(self.chan8_scaled);
24847 __tmp.put_u8(self.port);
24848 __tmp.put_u8(self.rssi);
24849 if matches!(version, MavlinkVersion::V2) {
24850 let len = __tmp.len();
24851 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24852 } else {
24853 __tmp.len()
24854 }
24855 }
24856}
24857#[deprecated = " See `MAV_CMD_SET_MESSAGE_INTERVAL ` (Deprecated since 2015-08)"]
24858#[doc = "id: 66"]
24859#[doc = "Request a data stream."]
24860#[derive(Debug, Clone, PartialEq)]
24861#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24862#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24863pub struct REQUEST_DATA_STREAM_DATA {
24864 #[doc = "The requested message rate"]
24865 pub req_message_rate: u16,
24866 #[doc = "The target requested to send the message stream."]
24867 pub target_system: u8,
24868 #[doc = "The target requested to send the message stream."]
24869 pub target_component: u8,
24870 #[doc = "The ID of the requested data stream"]
24871 pub req_stream_id: u8,
24872 #[doc = "1 to start sending, 0 to stop sending."]
24873 pub start_stop: u8,
24874}
24875impl REQUEST_DATA_STREAM_DATA {
24876 pub const ENCODED_LEN: usize = 6usize;
24877 pub const DEFAULT: Self = Self {
24878 req_message_rate: 0_u16,
24879 target_system: 0_u8,
24880 target_component: 0_u8,
24881 req_stream_id: 0_u8,
24882 start_stop: 0_u8,
24883 };
24884 #[cfg(feature = "arbitrary")]
24885 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24886 use arbitrary::{Arbitrary, Unstructured};
24887 let mut buf = [0u8; 1024];
24888 rng.fill_bytes(&mut buf);
24889 let mut unstructured = Unstructured::new(&buf);
24890 Self::arbitrary(&mut unstructured).unwrap_or_default()
24891 }
24892}
24893impl Default for REQUEST_DATA_STREAM_DATA {
24894 fn default() -> Self {
24895 Self::DEFAULT.clone()
24896 }
24897}
24898impl MessageData for REQUEST_DATA_STREAM_DATA {
24899 type Message = MavMessage;
24900 const ID: u32 = 66u32;
24901 const NAME: &'static str = "REQUEST_DATA_STREAM";
24902 const EXTRA_CRC: u8 = 148u8;
24903 const ENCODED_LEN: usize = 6usize;
24904 fn deser(
24905 _version: MavlinkVersion,
24906 __input: &[u8],
24907 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24908 let avail_len = __input.len();
24909 let mut payload_buf = [0; Self::ENCODED_LEN];
24910 let mut buf = if avail_len < Self::ENCODED_LEN {
24911 payload_buf[0..avail_len].copy_from_slice(__input);
24912 Bytes::new(&payload_buf)
24913 } else {
24914 Bytes::new(__input)
24915 };
24916 let mut __struct = Self::default();
24917 __struct.req_message_rate = buf.get_u16_le();
24918 __struct.target_system = buf.get_u8();
24919 __struct.target_component = buf.get_u8();
24920 __struct.req_stream_id = buf.get_u8();
24921 __struct.start_stop = buf.get_u8();
24922 Ok(__struct)
24923 }
24924 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24925 let mut __tmp = BytesMut::new(bytes);
24926 #[allow(clippy::absurd_extreme_comparisons)]
24927 #[allow(unused_comparisons)]
24928 if __tmp.remaining() < Self::ENCODED_LEN {
24929 panic!(
24930 "buffer is too small (need {} bytes, but got {})",
24931 Self::ENCODED_LEN,
24932 __tmp.remaining(),
24933 )
24934 }
24935 __tmp.put_u16_le(self.req_message_rate);
24936 __tmp.put_u8(self.target_system);
24937 __tmp.put_u8(self.target_component);
24938 __tmp.put_u8(self.req_stream_id);
24939 __tmp.put_u8(self.start_stop);
24940 if matches!(version, MavlinkVersion::V2) {
24941 let len = __tmp.len();
24942 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24943 } else {
24944 __tmp.len()
24945 }
24946 }
24947}
24948#[doc = "id: 412"]
24949#[doc = "Request one or more events to be (re-)sent. If first_sequence==last_sequence, only a single event is requested. Note that first_sequence can be larger than last_sequence (because the sequence number can wrap). Each sequence will trigger an EVENT or EVENT_ERROR response."]
24950#[derive(Debug, Clone, PartialEq)]
24951#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24952#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24953pub struct REQUEST_EVENT_DATA {
24954 #[doc = "First sequence number of the requested event."]
24955 pub first_sequence: u16,
24956 #[doc = "Last sequence number of the requested event."]
24957 pub last_sequence: u16,
24958 #[doc = "System ID"]
24959 pub target_system: u8,
24960 #[doc = "Component ID"]
24961 pub target_component: u8,
24962}
24963impl REQUEST_EVENT_DATA {
24964 pub const ENCODED_LEN: usize = 6usize;
24965 pub const DEFAULT: Self = Self {
24966 first_sequence: 0_u16,
24967 last_sequence: 0_u16,
24968 target_system: 0_u8,
24969 target_component: 0_u8,
24970 };
24971 #[cfg(feature = "arbitrary")]
24972 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24973 use arbitrary::{Arbitrary, Unstructured};
24974 let mut buf = [0u8; 1024];
24975 rng.fill_bytes(&mut buf);
24976 let mut unstructured = Unstructured::new(&buf);
24977 Self::arbitrary(&mut unstructured).unwrap_or_default()
24978 }
24979}
24980impl Default for REQUEST_EVENT_DATA {
24981 fn default() -> Self {
24982 Self::DEFAULT.clone()
24983 }
24984}
24985impl MessageData for REQUEST_EVENT_DATA {
24986 type Message = MavMessage;
24987 const ID: u32 = 412u32;
24988 const NAME: &'static str = "REQUEST_EVENT";
24989 const EXTRA_CRC: u8 = 33u8;
24990 const ENCODED_LEN: usize = 6usize;
24991 fn deser(
24992 _version: MavlinkVersion,
24993 __input: &[u8],
24994 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24995 let avail_len = __input.len();
24996 let mut payload_buf = [0; Self::ENCODED_LEN];
24997 let mut buf = if avail_len < Self::ENCODED_LEN {
24998 payload_buf[0..avail_len].copy_from_slice(__input);
24999 Bytes::new(&payload_buf)
25000 } else {
25001 Bytes::new(__input)
25002 };
25003 let mut __struct = Self::default();
25004 __struct.first_sequence = buf.get_u16_le();
25005 __struct.last_sequence = buf.get_u16_le();
25006 __struct.target_system = buf.get_u8();
25007 __struct.target_component = buf.get_u8();
25008 Ok(__struct)
25009 }
25010 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25011 let mut __tmp = BytesMut::new(bytes);
25012 #[allow(clippy::absurd_extreme_comparisons)]
25013 #[allow(unused_comparisons)]
25014 if __tmp.remaining() < Self::ENCODED_LEN {
25015 panic!(
25016 "buffer is too small (need {} bytes, but got {})",
25017 Self::ENCODED_LEN,
25018 __tmp.remaining(),
25019 )
25020 }
25021 __tmp.put_u16_le(self.first_sequence);
25022 __tmp.put_u16_le(self.last_sequence);
25023 __tmp.put_u8(self.target_system);
25024 __tmp.put_u8(self.target_component);
25025 if matches!(version, MavlinkVersion::V2) {
25026 let len = __tmp.len();
25027 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25028 } else {
25029 __tmp.len()
25030 }
25031 }
25032}
25033#[doc = "id: 142"]
25034#[doc = "The autopilot is requesting a resource (file, binary, other type of data)."]
25035#[derive(Debug, Clone, PartialEq)]
25036#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25037#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25038pub struct RESOURCE_REQUEST_DATA {
25039 #[doc = "Request ID. This ID should be re-used when sending back URI contents"]
25040 pub request_id: u8,
25041 #[doc = "The type of requested URI. 0 = a file via URL. 1 = a UAVCAN binary"]
25042 pub uri_type: u8,
25043 #[doc = "The requested unique resource identifier (URI). It is not necessarily a straight domain name (depends on the URI type enum)"]
25044 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
25045 pub uri: [u8; 120],
25046 #[doc = "The way the autopilot wants to receive the URI. 0 = MAVLink FTP. 1 = binary stream."]
25047 pub transfer_type: u8,
25048 #[doc = "The storage path the autopilot wants the URI to be stored in. Will only be valid if the transfer_type has a storage associated (e.g. MAVLink FTP)."]
25049 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
25050 pub storage: [u8; 120],
25051}
25052impl RESOURCE_REQUEST_DATA {
25053 pub const ENCODED_LEN: usize = 243usize;
25054 pub const DEFAULT: Self = Self {
25055 request_id: 0_u8,
25056 uri_type: 0_u8,
25057 uri: [0_u8; 120usize],
25058 transfer_type: 0_u8,
25059 storage: [0_u8; 120usize],
25060 };
25061 #[cfg(feature = "arbitrary")]
25062 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25063 use arbitrary::{Arbitrary, Unstructured};
25064 let mut buf = [0u8; 1024];
25065 rng.fill_bytes(&mut buf);
25066 let mut unstructured = Unstructured::new(&buf);
25067 Self::arbitrary(&mut unstructured).unwrap_or_default()
25068 }
25069}
25070impl Default for RESOURCE_REQUEST_DATA {
25071 fn default() -> Self {
25072 Self::DEFAULT.clone()
25073 }
25074}
25075impl MessageData for RESOURCE_REQUEST_DATA {
25076 type Message = MavMessage;
25077 const ID: u32 = 142u32;
25078 const NAME: &'static str = "RESOURCE_REQUEST";
25079 const EXTRA_CRC: u8 = 72u8;
25080 const ENCODED_LEN: usize = 243usize;
25081 fn deser(
25082 _version: MavlinkVersion,
25083 __input: &[u8],
25084 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25085 let avail_len = __input.len();
25086 let mut payload_buf = [0; Self::ENCODED_LEN];
25087 let mut buf = if avail_len < Self::ENCODED_LEN {
25088 payload_buf[0..avail_len].copy_from_slice(__input);
25089 Bytes::new(&payload_buf)
25090 } else {
25091 Bytes::new(__input)
25092 };
25093 let mut __struct = Self::default();
25094 __struct.request_id = buf.get_u8();
25095 __struct.uri_type = buf.get_u8();
25096 for v in &mut __struct.uri {
25097 let val = buf.get_u8();
25098 *v = val;
25099 }
25100 __struct.transfer_type = buf.get_u8();
25101 for v in &mut __struct.storage {
25102 let val = buf.get_u8();
25103 *v = val;
25104 }
25105 Ok(__struct)
25106 }
25107 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25108 let mut __tmp = BytesMut::new(bytes);
25109 #[allow(clippy::absurd_extreme_comparisons)]
25110 #[allow(unused_comparisons)]
25111 if __tmp.remaining() < Self::ENCODED_LEN {
25112 panic!(
25113 "buffer is too small (need {} bytes, but got {})",
25114 Self::ENCODED_LEN,
25115 __tmp.remaining(),
25116 )
25117 }
25118 __tmp.put_u8(self.request_id);
25119 __tmp.put_u8(self.uri_type);
25120 for val in &self.uri {
25121 __tmp.put_u8(*val);
25122 }
25123 __tmp.put_u8(self.transfer_type);
25124 for val in &self.storage {
25125 __tmp.put_u8(*val);
25126 }
25127 if matches!(version, MavlinkVersion::V2) {
25128 let len = __tmp.len();
25129 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25130 } else {
25131 __tmp.len()
25132 }
25133 }
25134}
25135#[doc = "id: 413"]
25136#[doc = "Response to a REQUEST_EVENT in case of an error (e.g. the event is not available anymore)."]
25137#[derive(Debug, Clone, PartialEq)]
25138#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25139#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25140pub struct RESPONSE_EVENT_ERROR_DATA {
25141 #[doc = "Sequence number."]
25142 pub sequence: u16,
25143 #[doc = "Oldest Sequence number that is still available after the sequence set in REQUEST_EVENT."]
25144 pub sequence_oldest_available: u16,
25145 #[doc = "System ID"]
25146 pub target_system: u8,
25147 #[doc = "Component ID"]
25148 pub target_component: u8,
25149 #[doc = "Error reason."]
25150 pub reason: MavEventErrorReason,
25151}
25152impl RESPONSE_EVENT_ERROR_DATA {
25153 pub const ENCODED_LEN: usize = 7usize;
25154 pub const DEFAULT: Self = Self {
25155 sequence: 0_u16,
25156 sequence_oldest_available: 0_u16,
25157 target_system: 0_u8,
25158 target_component: 0_u8,
25159 reason: MavEventErrorReason::DEFAULT,
25160 };
25161 #[cfg(feature = "arbitrary")]
25162 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25163 use arbitrary::{Arbitrary, Unstructured};
25164 let mut buf = [0u8; 1024];
25165 rng.fill_bytes(&mut buf);
25166 let mut unstructured = Unstructured::new(&buf);
25167 Self::arbitrary(&mut unstructured).unwrap_or_default()
25168 }
25169}
25170impl Default for RESPONSE_EVENT_ERROR_DATA {
25171 fn default() -> Self {
25172 Self::DEFAULT.clone()
25173 }
25174}
25175impl MessageData for RESPONSE_EVENT_ERROR_DATA {
25176 type Message = MavMessage;
25177 const ID: u32 = 413u32;
25178 const NAME: &'static str = "RESPONSE_EVENT_ERROR";
25179 const EXTRA_CRC: u8 = 77u8;
25180 const ENCODED_LEN: usize = 7usize;
25181 fn deser(
25182 _version: MavlinkVersion,
25183 __input: &[u8],
25184 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25185 let avail_len = __input.len();
25186 let mut payload_buf = [0; Self::ENCODED_LEN];
25187 let mut buf = if avail_len < Self::ENCODED_LEN {
25188 payload_buf[0..avail_len].copy_from_slice(__input);
25189 Bytes::new(&payload_buf)
25190 } else {
25191 Bytes::new(__input)
25192 };
25193 let mut __struct = Self::default();
25194 __struct.sequence = buf.get_u16_le();
25195 __struct.sequence_oldest_available = buf.get_u16_le();
25196 __struct.target_system = buf.get_u8();
25197 __struct.target_component = buf.get_u8();
25198 let tmp = buf.get_u8();
25199 __struct.reason =
25200 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
25201 enum_type: "MavEventErrorReason",
25202 value: tmp as u32,
25203 })?;
25204 Ok(__struct)
25205 }
25206 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25207 let mut __tmp = BytesMut::new(bytes);
25208 #[allow(clippy::absurd_extreme_comparisons)]
25209 #[allow(unused_comparisons)]
25210 if __tmp.remaining() < Self::ENCODED_LEN {
25211 panic!(
25212 "buffer is too small (need {} bytes, but got {})",
25213 Self::ENCODED_LEN,
25214 __tmp.remaining(),
25215 )
25216 }
25217 __tmp.put_u16_le(self.sequence);
25218 __tmp.put_u16_le(self.sequence_oldest_available);
25219 __tmp.put_u8(self.target_system);
25220 __tmp.put_u8(self.target_component);
25221 __tmp.put_u8(self.reason as u8);
25222 if matches!(version, MavlinkVersion::V2) {
25223 let len = __tmp.len();
25224 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25225 } else {
25226 __tmp.len()
25227 }
25228 }
25229}
25230#[doc = "id: 55"]
25231#[doc = "Read out the safety zone the MAV currently assumes."]
25232#[derive(Debug, Clone, PartialEq)]
25233#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25234#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25235pub struct SAFETY_ALLOWED_AREA_DATA {
25236 #[doc = "x position 1 / Latitude 1"]
25237 pub p1x: f32,
25238 #[doc = "y position 1 / Longitude 1"]
25239 pub p1y: f32,
25240 #[doc = "z position 1 / Altitude 1"]
25241 pub p1z: f32,
25242 #[doc = "x position 2 / Latitude 2"]
25243 pub p2x: f32,
25244 #[doc = "y position 2 / Longitude 2"]
25245 pub p2y: f32,
25246 #[doc = "z position 2 / Altitude 2"]
25247 pub p2z: f32,
25248 #[doc = "Coordinate frame. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down."]
25249 pub frame: MavFrame,
25250}
25251impl SAFETY_ALLOWED_AREA_DATA {
25252 pub const ENCODED_LEN: usize = 25usize;
25253 pub const DEFAULT: Self = Self {
25254 p1x: 0.0_f32,
25255 p1y: 0.0_f32,
25256 p1z: 0.0_f32,
25257 p2x: 0.0_f32,
25258 p2y: 0.0_f32,
25259 p2z: 0.0_f32,
25260 frame: MavFrame::DEFAULT,
25261 };
25262 #[cfg(feature = "arbitrary")]
25263 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25264 use arbitrary::{Arbitrary, Unstructured};
25265 let mut buf = [0u8; 1024];
25266 rng.fill_bytes(&mut buf);
25267 let mut unstructured = Unstructured::new(&buf);
25268 Self::arbitrary(&mut unstructured).unwrap_or_default()
25269 }
25270}
25271impl Default for SAFETY_ALLOWED_AREA_DATA {
25272 fn default() -> Self {
25273 Self::DEFAULT.clone()
25274 }
25275}
25276impl MessageData for SAFETY_ALLOWED_AREA_DATA {
25277 type Message = MavMessage;
25278 const ID: u32 = 55u32;
25279 const NAME: &'static str = "SAFETY_ALLOWED_AREA";
25280 const EXTRA_CRC: u8 = 3u8;
25281 const ENCODED_LEN: usize = 25usize;
25282 fn deser(
25283 _version: MavlinkVersion,
25284 __input: &[u8],
25285 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25286 let avail_len = __input.len();
25287 let mut payload_buf = [0; Self::ENCODED_LEN];
25288 let mut buf = if avail_len < Self::ENCODED_LEN {
25289 payload_buf[0..avail_len].copy_from_slice(__input);
25290 Bytes::new(&payload_buf)
25291 } else {
25292 Bytes::new(__input)
25293 };
25294 let mut __struct = Self::default();
25295 __struct.p1x = buf.get_f32_le();
25296 __struct.p1y = buf.get_f32_le();
25297 __struct.p1z = buf.get_f32_le();
25298 __struct.p2x = buf.get_f32_le();
25299 __struct.p2y = buf.get_f32_le();
25300 __struct.p2z = buf.get_f32_le();
25301 let tmp = buf.get_u8();
25302 __struct.frame =
25303 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
25304 enum_type: "MavFrame",
25305 value: tmp as u32,
25306 })?;
25307 Ok(__struct)
25308 }
25309 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25310 let mut __tmp = BytesMut::new(bytes);
25311 #[allow(clippy::absurd_extreme_comparisons)]
25312 #[allow(unused_comparisons)]
25313 if __tmp.remaining() < Self::ENCODED_LEN {
25314 panic!(
25315 "buffer is too small (need {} bytes, but got {})",
25316 Self::ENCODED_LEN,
25317 __tmp.remaining(),
25318 )
25319 }
25320 __tmp.put_f32_le(self.p1x);
25321 __tmp.put_f32_le(self.p1y);
25322 __tmp.put_f32_le(self.p1z);
25323 __tmp.put_f32_le(self.p2x);
25324 __tmp.put_f32_le(self.p2y);
25325 __tmp.put_f32_le(self.p2z);
25326 __tmp.put_u8(self.frame as u8);
25327 if matches!(version, MavlinkVersion::V2) {
25328 let len = __tmp.len();
25329 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25330 } else {
25331 __tmp.len()
25332 }
25333 }
25334}
25335#[doc = "id: 54"]
25336#[doc = "Set a safety zone (volume), which is defined by two corners of a cube. This message can be used to tell the MAV which setpoints/waypoints to accept and which to reject. Safety areas are often enforced by national or competition regulations."]
25337#[derive(Debug, Clone, PartialEq)]
25338#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25339#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25340pub struct SAFETY_SET_ALLOWED_AREA_DATA {
25341 #[doc = "x position 1 / Latitude 1"]
25342 pub p1x: f32,
25343 #[doc = "y position 1 / Longitude 1"]
25344 pub p1y: f32,
25345 #[doc = "z position 1 / Altitude 1"]
25346 pub p1z: f32,
25347 #[doc = "x position 2 / Latitude 2"]
25348 pub p2x: f32,
25349 #[doc = "y position 2 / Longitude 2"]
25350 pub p2y: f32,
25351 #[doc = "z position 2 / Altitude 2"]
25352 pub p2z: f32,
25353 #[doc = "System ID"]
25354 pub target_system: u8,
25355 #[doc = "Component ID"]
25356 pub target_component: u8,
25357 #[doc = "Coordinate frame. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down."]
25358 pub frame: MavFrame,
25359}
25360impl SAFETY_SET_ALLOWED_AREA_DATA {
25361 pub const ENCODED_LEN: usize = 27usize;
25362 pub const DEFAULT: Self = Self {
25363 p1x: 0.0_f32,
25364 p1y: 0.0_f32,
25365 p1z: 0.0_f32,
25366 p2x: 0.0_f32,
25367 p2y: 0.0_f32,
25368 p2z: 0.0_f32,
25369 target_system: 0_u8,
25370 target_component: 0_u8,
25371 frame: MavFrame::DEFAULT,
25372 };
25373 #[cfg(feature = "arbitrary")]
25374 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25375 use arbitrary::{Arbitrary, Unstructured};
25376 let mut buf = [0u8; 1024];
25377 rng.fill_bytes(&mut buf);
25378 let mut unstructured = Unstructured::new(&buf);
25379 Self::arbitrary(&mut unstructured).unwrap_or_default()
25380 }
25381}
25382impl Default for SAFETY_SET_ALLOWED_AREA_DATA {
25383 fn default() -> Self {
25384 Self::DEFAULT.clone()
25385 }
25386}
25387impl MessageData for SAFETY_SET_ALLOWED_AREA_DATA {
25388 type Message = MavMessage;
25389 const ID: u32 = 54u32;
25390 const NAME: &'static str = "SAFETY_SET_ALLOWED_AREA";
25391 const EXTRA_CRC: u8 = 15u8;
25392 const ENCODED_LEN: usize = 27usize;
25393 fn deser(
25394 _version: MavlinkVersion,
25395 __input: &[u8],
25396 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25397 let avail_len = __input.len();
25398 let mut payload_buf = [0; Self::ENCODED_LEN];
25399 let mut buf = if avail_len < Self::ENCODED_LEN {
25400 payload_buf[0..avail_len].copy_from_slice(__input);
25401 Bytes::new(&payload_buf)
25402 } else {
25403 Bytes::new(__input)
25404 };
25405 let mut __struct = Self::default();
25406 __struct.p1x = buf.get_f32_le();
25407 __struct.p1y = buf.get_f32_le();
25408 __struct.p1z = buf.get_f32_le();
25409 __struct.p2x = buf.get_f32_le();
25410 __struct.p2y = buf.get_f32_le();
25411 __struct.p2z = buf.get_f32_le();
25412 __struct.target_system = buf.get_u8();
25413 __struct.target_component = buf.get_u8();
25414 let tmp = buf.get_u8();
25415 __struct.frame =
25416 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
25417 enum_type: "MavFrame",
25418 value: tmp as u32,
25419 })?;
25420 Ok(__struct)
25421 }
25422 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25423 let mut __tmp = BytesMut::new(bytes);
25424 #[allow(clippy::absurd_extreme_comparisons)]
25425 #[allow(unused_comparisons)]
25426 if __tmp.remaining() < Self::ENCODED_LEN {
25427 panic!(
25428 "buffer is too small (need {} bytes, but got {})",
25429 Self::ENCODED_LEN,
25430 __tmp.remaining(),
25431 )
25432 }
25433 __tmp.put_f32_le(self.p1x);
25434 __tmp.put_f32_le(self.p1y);
25435 __tmp.put_f32_le(self.p1z);
25436 __tmp.put_f32_le(self.p2x);
25437 __tmp.put_f32_le(self.p2y);
25438 __tmp.put_f32_le(self.p2z);
25439 __tmp.put_u8(self.target_system);
25440 __tmp.put_u8(self.target_component);
25441 __tmp.put_u8(self.frame as u8);
25442 if matches!(version, MavlinkVersion::V2) {
25443 let len = __tmp.len();
25444 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25445 } else {
25446 __tmp.len()
25447 }
25448 }
25449}
25450#[doc = "id: 26"]
25451#[doc = "The RAW IMU readings for the usual 9DOF sensor setup. This message should contain the scaled values to the described units."]
25452#[derive(Debug, Clone, PartialEq)]
25453#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25454#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25455pub struct SCALED_IMU_DATA {
25456 #[doc = "Timestamp (time since system boot)."]
25457 pub time_boot_ms: u32,
25458 #[doc = "X acceleration"]
25459 pub xacc: i16,
25460 #[doc = "Y acceleration"]
25461 pub yacc: i16,
25462 #[doc = "Z acceleration"]
25463 pub zacc: i16,
25464 #[doc = "Angular speed around X axis"]
25465 pub xgyro: i16,
25466 #[doc = "Angular speed around Y axis"]
25467 pub ygyro: i16,
25468 #[doc = "Angular speed around Z axis"]
25469 pub zgyro: i16,
25470 #[doc = "X Magnetic field"]
25471 pub xmag: i16,
25472 #[doc = "Y Magnetic field"]
25473 pub ymag: i16,
25474 #[doc = "Z Magnetic field"]
25475 pub zmag: i16,
25476 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
25477 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25478 pub temperature: i16,
25479}
25480impl SCALED_IMU_DATA {
25481 pub const ENCODED_LEN: usize = 24usize;
25482 pub const DEFAULT: Self = Self {
25483 time_boot_ms: 0_u32,
25484 xacc: 0_i16,
25485 yacc: 0_i16,
25486 zacc: 0_i16,
25487 xgyro: 0_i16,
25488 ygyro: 0_i16,
25489 zgyro: 0_i16,
25490 xmag: 0_i16,
25491 ymag: 0_i16,
25492 zmag: 0_i16,
25493 temperature: 0_i16,
25494 };
25495 #[cfg(feature = "arbitrary")]
25496 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25497 use arbitrary::{Arbitrary, Unstructured};
25498 let mut buf = [0u8; 1024];
25499 rng.fill_bytes(&mut buf);
25500 let mut unstructured = Unstructured::new(&buf);
25501 Self::arbitrary(&mut unstructured).unwrap_or_default()
25502 }
25503}
25504impl Default for SCALED_IMU_DATA {
25505 fn default() -> Self {
25506 Self::DEFAULT.clone()
25507 }
25508}
25509impl MessageData for SCALED_IMU_DATA {
25510 type Message = MavMessage;
25511 const ID: u32 = 26u32;
25512 const NAME: &'static str = "SCALED_IMU";
25513 const EXTRA_CRC: u8 = 170u8;
25514 const ENCODED_LEN: usize = 24usize;
25515 fn deser(
25516 _version: MavlinkVersion,
25517 __input: &[u8],
25518 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25519 let avail_len = __input.len();
25520 let mut payload_buf = [0; Self::ENCODED_LEN];
25521 let mut buf = if avail_len < Self::ENCODED_LEN {
25522 payload_buf[0..avail_len].copy_from_slice(__input);
25523 Bytes::new(&payload_buf)
25524 } else {
25525 Bytes::new(__input)
25526 };
25527 let mut __struct = Self::default();
25528 __struct.time_boot_ms = buf.get_u32_le();
25529 __struct.xacc = buf.get_i16_le();
25530 __struct.yacc = buf.get_i16_le();
25531 __struct.zacc = buf.get_i16_le();
25532 __struct.xgyro = buf.get_i16_le();
25533 __struct.ygyro = buf.get_i16_le();
25534 __struct.zgyro = buf.get_i16_le();
25535 __struct.xmag = buf.get_i16_le();
25536 __struct.ymag = buf.get_i16_le();
25537 __struct.zmag = buf.get_i16_le();
25538 __struct.temperature = buf.get_i16_le();
25539 Ok(__struct)
25540 }
25541 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25542 let mut __tmp = BytesMut::new(bytes);
25543 #[allow(clippy::absurd_extreme_comparisons)]
25544 #[allow(unused_comparisons)]
25545 if __tmp.remaining() < Self::ENCODED_LEN {
25546 panic!(
25547 "buffer is too small (need {} bytes, but got {})",
25548 Self::ENCODED_LEN,
25549 __tmp.remaining(),
25550 )
25551 }
25552 __tmp.put_u32_le(self.time_boot_ms);
25553 __tmp.put_i16_le(self.xacc);
25554 __tmp.put_i16_le(self.yacc);
25555 __tmp.put_i16_le(self.zacc);
25556 __tmp.put_i16_le(self.xgyro);
25557 __tmp.put_i16_le(self.ygyro);
25558 __tmp.put_i16_le(self.zgyro);
25559 __tmp.put_i16_le(self.xmag);
25560 __tmp.put_i16_le(self.ymag);
25561 __tmp.put_i16_le(self.zmag);
25562 __tmp.put_i16_le(self.temperature);
25563 if matches!(version, MavlinkVersion::V2) {
25564 let len = __tmp.len();
25565 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25566 } else {
25567 __tmp.len()
25568 }
25569 }
25570}
25571#[doc = "id: 116"]
25572#[doc = "The RAW IMU readings for secondary 9DOF sensor setup. This message should contain the scaled values to the described units."]
25573#[derive(Debug, Clone, PartialEq)]
25574#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25575#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25576pub struct SCALED_IMU2_DATA {
25577 #[doc = "Timestamp (time since system boot)."]
25578 pub time_boot_ms: u32,
25579 #[doc = "X acceleration"]
25580 pub xacc: i16,
25581 #[doc = "Y acceleration"]
25582 pub yacc: i16,
25583 #[doc = "Z acceleration"]
25584 pub zacc: i16,
25585 #[doc = "Angular speed around X axis"]
25586 pub xgyro: i16,
25587 #[doc = "Angular speed around Y axis"]
25588 pub ygyro: i16,
25589 #[doc = "Angular speed around Z axis"]
25590 pub zgyro: i16,
25591 #[doc = "X Magnetic field"]
25592 pub xmag: i16,
25593 #[doc = "Y Magnetic field"]
25594 pub ymag: i16,
25595 #[doc = "Z Magnetic field"]
25596 pub zmag: i16,
25597 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
25598 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25599 pub temperature: i16,
25600}
25601impl SCALED_IMU2_DATA {
25602 pub const ENCODED_LEN: usize = 24usize;
25603 pub const DEFAULT: Self = Self {
25604 time_boot_ms: 0_u32,
25605 xacc: 0_i16,
25606 yacc: 0_i16,
25607 zacc: 0_i16,
25608 xgyro: 0_i16,
25609 ygyro: 0_i16,
25610 zgyro: 0_i16,
25611 xmag: 0_i16,
25612 ymag: 0_i16,
25613 zmag: 0_i16,
25614 temperature: 0_i16,
25615 };
25616 #[cfg(feature = "arbitrary")]
25617 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25618 use arbitrary::{Arbitrary, Unstructured};
25619 let mut buf = [0u8; 1024];
25620 rng.fill_bytes(&mut buf);
25621 let mut unstructured = Unstructured::new(&buf);
25622 Self::arbitrary(&mut unstructured).unwrap_or_default()
25623 }
25624}
25625impl Default for SCALED_IMU2_DATA {
25626 fn default() -> Self {
25627 Self::DEFAULT.clone()
25628 }
25629}
25630impl MessageData for SCALED_IMU2_DATA {
25631 type Message = MavMessage;
25632 const ID: u32 = 116u32;
25633 const NAME: &'static str = "SCALED_IMU2";
25634 const EXTRA_CRC: u8 = 76u8;
25635 const ENCODED_LEN: usize = 24usize;
25636 fn deser(
25637 _version: MavlinkVersion,
25638 __input: &[u8],
25639 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25640 let avail_len = __input.len();
25641 let mut payload_buf = [0; Self::ENCODED_LEN];
25642 let mut buf = if avail_len < Self::ENCODED_LEN {
25643 payload_buf[0..avail_len].copy_from_slice(__input);
25644 Bytes::new(&payload_buf)
25645 } else {
25646 Bytes::new(__input)
25647 };
25648 let mut __struct = Self::default();
25649 __struct.time_boot_ms = buf.get_u32_le();
25650 __struct.xacc = buf.get_i16_le();
25651 __struct.yacc = buf.get_i16_le();
25652 __struct.zacc = buf.get_i16_le();
25653 __struct.xgyro = buf.get_i16_le();
25654 __struct.ygyro = buf.get_i16_le();
25655 __struct.zgyro = buf.get_i16_le();
25656 __struct.xmag = buf.get_i16_le();
25657 __struct.ymag = buf.get_i16_le();
25658 __struct.zmag = buf.get_i16_le();
25659 __struct.temperature = buf.get_i16_le();
25660 Ok(__struct)
25661 }
25662 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25663 let mut __tmp = BytesMut::new(bytes);
25664 #[allow(clippy::absurd_extreme_comparisons)]
25665 #[allow(unused_comparisons)]
25666 if __tmp.remaining() < Self::ENCODED_LEN {
25667 panic!(
25668 "buffer is too small (need {} bytes, but got {})",
25669 Self::ENCODED_LEN,
25670 __tmp.remaining(),
25671 )
25672 }
25673 __tmp.put_u32_le(self.time_boot_ms);
25674 __tmp.put_i16_le(self.xacc);
25675 __tmp.put_i16_le(self.yacc);
25676 __tmp.put_i16_le(self.zacc);
25677 __tmp.put_i16_le(self.xgyro);
25678 __tmp.put_i16_le(self.ygyro);
25679 __tmp.put_i16_le(self.zgyro);
25680 __tmp.put_i16_le(self.xmag);
25681 __tmp.put_i16_le(self.ymag);
25682 __tmp.put_i16_le(self.zmag);
25683 __tmp.put_i16_le(self.temperature);
25684 if matches!(version, MavlinkVersion::V2) {
25685 let len = __tmp.len();
25686 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25687 } else {
25688 __tmp.len()
25689 }
25690 }
25691}
25692#[doc = "id: 129"]
25693#[doc = "The RAW IMU readings for 3rd 9DOF sensor setup. This message should contain the scaled values to the described units."]
25694#[derive(Debug, Clone, PartialEq)]
25695#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25696#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25697pub struct SCALED_IMU3_DATA {
25698 #[doc = "Timestamp (time since system boot)."]
25699 pub time_boot_ms: u32,
25700 #[doc = "X acceleration"]
25701 pub xacc: i16,
25702 #[doc = "Y acceleration"]
25703 pub yacc: i16,
25704 #[doc = "Z acceleration"]
25705 pub zacc: i16,
25706 #[doc = "Angular speed around X axis"]
25707 pub xgyro: i16,
25708 #[doc = "Angular speed around Y axis"]
25709 pub ygyro: i16,
25710 #[doc = "Angular speed around Z axis"]
25711 pub zgyro: i16,
25712 #[doc = "X Magnetic field"]
25713 pub xmag: i16,
25714 #[doc = "Y Magnetic field"]
25715 pub ymag: i16,
25716 #[doc = "Z Magnetic field"]
25717 pub zmag: i16,
25718 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
25719 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25720 pub temperature: i16,
25721}
25722impl SCALED_IMU3_DATA {
25723 pub const ENCODED_LEN: usize = 24usize;
25724 pub const DEFAULT: Self = Self {
25725 time_boot_ms: 0_u32,
25726 xacc: 0_i16,
25727 yacc: 0_i16,
25728 zacc: 0_i16,
25729 xgyro: 0_i16,
25730 ygyro: 0_i16,
25731 zgyro: 0_i16,
25732 xmag: 0_i16,
25733 ymag: 0_i16,
25734 zmag: 0_i16,
25735 temperature: 0_i16,
25736 };
25737 #[cfg(feature = "arbitrary")]
25738 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25739 use arbitrary::{Arbitrary, Unstructured};
25740 let mut buf = [0u8; 1024];
25741 rng.fill_bytes(&mut buf);
25742 let mut unstructured = Unstructured::new(&buf);
25743 Self::arbitrary(&mut unstructured).unwrap_or_default()
25744 }
25745}
25746impl Default for SCALED_IMU3_DATA {
25747 fn default() -> Self {
25748 Self::DEFAULT.clone()
25749 }
25750}
25751impl MessageData for SCALED_IMU3_DATA {
25752 type Message = MavMessage;
25753 const ID: u32 = 129u32;
25754 const NAME: &'static str = "SCALED_IMU3";
25755 const EXTRA_CRC: u8 = 46u8;
25756 const ENCODED_LEN: usize = 24usize;
25757 fn deser(
25758 _version: MavlinkVersion,
25759 __input: &[u8],
25760 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25761 let avail_len = __input.len();
25762 let mut payload_buf = [0; Self::ENCODED_LEN];
25763 let mut buf = if avail_len < Self::ENCODED_LEN {
25764 payload_buf[0..avail_len].copy_from_slice(__input);
25765 Bytes::new(&payload_buf)
25766 } else {
25767 Bytes::new(__input)
25768 };
25769 let mut __struct = Self::default();
25770 __struct.time_boot_ms = buf.get_u32_le();
25771 __struct.xacc = buf.get_i16_le();
25772 __struct.yacc = buf.get_i16_le();
25773 __struct.zacc = buf.get_i16_le();
25774 __struct.xgyro = buf.get_i16_le();
25775 __struct.ygyro = buf.get_i16_le();
25776 __struct.zgyro = buf.get_i16_le();
25777 __struct.xmag = buf.get_i16_le();
25778 __struct.ymag = buf.get_i16_le();
25779 __struct.zmag = buf.get_i16_le();
25780 __struct.temperature = buf.get_i16_le();
25781 Ok(__struct)
25782 }
25783 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25784 let mut __tmp = BytesMut::new(bytes);
25785 #[allow(clippy::absurd_extreme_comparisons)]
25786 #[allow(unused_comparisons)]
25787 if __tmp.remaining() < Self::ENCODED_LEN {
25788 panic!(
25789 "buffer is too small (need {} bytes, but got {})",
25790 Self::ENCODED_LEN,
25791 __tmp.remaining(),
25792 )
25793 }
25794 __tmp.put_u32_le(self.time_boot_ms);
25795 __tmp.put_i16_le(self.xacc);
25796 __tmp.put_i16_le(self.yacc);
25797 __tmp.put_i16_le(self.zacc);
25798 __tmp.put_i16_le(self.xgyro);
25799 __tmp.put_i16_le(self.ygyro);
25800 __tmp.put_i16_le(self.zgyro);
25801 __tmp.put_i16_le(self.xmag);
25802 __tmp.put_i16_le(self.ymag);
25803 __tmp.put_i16_le(self.zmag);
25804 __tmp.put_i16_le(self.temperature);
25805 if matches!(version, MavlinkVersion::V2) {
25806 let len = __tmp.len();
25807 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25808 } else {
25809 __tmp.len()
25810 }
25811 }
25812}
25813#[doc = "id: 29"]
25814#[doc = "The pressure readings for the typical setup of one absolute and differential pressure sensor. The units are as specified in each field."]
25815#[derive(Debug, Clone, PartialEq)]
25816#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25817#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25818pub struct SCALED_PRESSURE_DATA {
25819 #[doc = "Timestamp (time since system boot)."]
25820 pub time_boot_ms: u32,
25821 #[doc = "Absolute pressure"]
25822 pub press_abs: f32,
25823 #[doc = "Differential pressure 1"]
25824 pub press_diff: f32,
25825 #[doc = "Absolute pressure temperature"]
25826 pub temperature: i16,
25827 #[doc = "Differential pressure temperature (0, if not available). Report values of 0 (or 1) as 1 cdegC."]
25828 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25829 pub temperature_press_diff: i16,
25830}
25831impl SCALED_PRESSURE_DATA {
25832 pub const ENCODED_LEN: usize = 16usize;
25833 pub const DEFAULT: Self = Self {
25834 time_boot_ms: 0_u32,
25835 press_abs: 0.0_f32,
25836 press_diff: 0.0_f32,
25837 temperature: 0_i16,
25838 temperature_press_diff: 0_i16,
25839 };
25840 #[cfg(feature = "arbitrary")]
25841 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25842 use arbitrary::{Arbitrary, Unstructured};
25843 let mut buf = [0u8; 1024];
25844 rng.fill_bytes(&mut buf);
25845 let mut unstructured = Unstructured::new(&buf);
25846 Self::arbitrary(&mut unstructured).unwrap_or_default()
25847 }
25848}
25849impl Default for SCALED_PRESSURE_DATA {
25850 fn default() -> Self {
25851 Self::DEFAULT.clone()
25852 }
25853}
25854impl MessageData for SCALED_PRESSURE_DATA {
25855 type Message = MavMessage;
25856 const ID: u32 = 29u32;
25857 const NAME: &'static str = "SCALED_PRESSURE";
25858 const EXTRA_CRC: u8 = 115u8;
25859 const ENCODED_LEN: usize = 16usize;
25860 fn deser(
25861 _version: MavlinkVersion,
25862 __input: &[u8],
25863 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25864 let avail_len = __input.len();
25865 let mut payload_buf = [0; Self::ENCODED_LEN];
25866 let mut buf = if avail_len < Self::ENCODED_LEN {
25867 payload_buf[0..avail_len].copy_from_slice(__input);
25868 Bytes::new(&payload_buf)
25869 } else {
25870 Bytes::new(__input)
25871 };
25872 let mut __struct = Self::default();
25873 __struct.time_boot_ms = buf.get_u32_le();
25874 __struct.press_abs = buf.get_f32_le();
25875 __struct.press_diff = buf.get_f32_le();
25876 __struct.temperature = buf.get_i16_le();
25877 __struct.temperature_press_diff = buf.get_i16_le();
25878 Ok(__struct)
25879 }
25880 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25881 let mut __tmp = BytesMut::new(bytes);
25882 #[allow(clippy::absurd_extreme_comparisons)]
25883 #[allow(unused_comparisons)]
25884 if __tmp.remaining() < Self::ENCODED_LEN {
25885 panic!(
25886 "buffer is too small (need {} bytes, but got {})",
25887 Self::ENCODED_LEN,
25888 __tmp.remaining(),
25889 )
25890 }
25891 __tmp.put_u32_le(self.time_boot_ms);
25892 __tmp.put_f32_le(self.press_abs);
25893 __tmp.put_f32_le(self.press_diff);
25894 __tmp.put_i16_le(self.temperature);
25895 __tmp.put_i16_le(self.temperature_press_diff);
25896 if matches!(version, MavlinkVersion::V2) {
25897 let len = __tmp.len();
25898 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25899 } else {
25900 __tmp.len()
25901 }
25902 }
25903}
25904#[doc = "id: 137"]
25905#[doc = "Barometer readings for 2nd barometer."]
25906#[derive(Debug, Clone, PartialEq)]
25907#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25908#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25909pub struct SCALED_PRESSURE2_DATA {
25910 #[doc = "Timestamp (time since system boot)."]
25911 pub time_boot_ms: u32,
25912 #[doc = "Absolute pressure"]
25913 pub press_abs: f32,
25914 #[doc = "Differential pressure"]
25915 pub press_diff: f32,
25916 #[doc = "Absolute pressure temperature"]
25917 pub temperature: i16,
25918 #[doc = "Differential pressure temperature (0, if not available). Report values of 0 (or 1) as 1 cdegC."]
25919 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25920 pub temperature_press_diff: i16,
25921}
25922impl SCALED_PRESSURE2_DATA {
25923 pub const ENCODED_LEN: usize = 16usize;
25924 pub const DEFAULT: Self = Self {
25925 time_boot_ms: 0_u32,
25926 press_abs: 0.0_f32,
25927 press_diff: 0.0_f32,
25928 temperature: 0_i16,
25929 temperature_press_diff: 0_i16,
25930 };
25931 #[cfg(feature = "arbitrary")]
25932 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25933 use arbitrary::{Arbitrary, Unstructured};
25934 let mut buf = [0u8; 1024];
25935 rng.fill_bytes(&mut buf);
25936 let mut unstructured = Unstructured::new(&buf);
25937 Self::arbitrary(&mut unstructured).unwrap_or_default()
25938 }
25939}
25940impl Default for SCALED_PRESSURE2_DATA {
25941 fn default() -> Self {
25942 Self::DEFAULT.clone()
25943 }
25944}
25945impl MessageData for SCALED_PRESSURE2_DATA {
25946 type Message = MavMessage;
25947 const ID: u32 = 137u32;
25948 const NAME: &'static str = "SCALED_PRESSURE2";
25949 const EXTRA_CRC: u8 = 195u8;
25950 const ENCODED_LEN: usize = 16usize;
25951 fn deser(
25952 _version: MavlinkVersion,
25953 __input: &[u8],
25954 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25955 let avail_len = __input.len();
25956 let mut payload_buf = [0; Self::ENCODED_LEN];
25957 let mut buf = if avail_len < Self::ENCODED_LEN {
25958 payload_buf[0..avail_len].copy_from_slice(__input);
25959 Bytes::new(&payload_buf)
25960 } else {
25961 Bytes::new(__input)
25962 };
25963 let mut __struct = Self::default();
25964 __struct.time_boot_ms = buf.get_u32_le();
25965 __struct.press_abs = buf.get_f32_le();
25966 __struct.press_diff = buf.get_f32_le();
25967 __struct.temperature = buf.get_i16_le();
25968 __struct.temperature_press_diff = buf.get_i16_le();
25969 Ok(__struct)
25970 }
25971 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25972 let mut __tmp = BytesMut::new(bytes);
25973 #[allow(clippy::absurd_extreme_comparisons)]
25974 #[allow(unused_comparisons)]
25975 if __tmp.remaining() < Self::ENCODED_LEN {
25976 panic!(
25977 "buffer is too small (need {} bytes, but got {})",
25978 Self::ENCODED_LEN,
25979 __tmp.remaining(),
25980 )
25981 }
25982 __tmp.put_u32_le(self.time_boot_ms);
25983 __tmp.put_f32_le(self.press_abs);
25984 __tmp.put_f32_le(self.press_diff);
25985 __tmp.put_i16_le(self.temperature);
25986 __tmp.put_i16_le(self.temperature_press_diff);
25987 if matches!(version, MavlinkVersion::V2) {
25988 let len = __tmp.len();
25989 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25990 } else {
25991 __tmp.len()
25992 }
25993 }
25994}
25995#[doc = "id: 143"]
25996#[doc = "Barometer readings for 3rd barometer."]
25997#[derive(Debug, Clone, PartialEq)]
25998#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25999#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26000pub struct SCALED_PRESSURE3_DATA {
26001 #[doc = "Timestamp (time since system boot)."]
26002 pub time_boot_ms: u32,
26003 #[doc = "Absolute pressure"]
26004 pub press_abs: f32,
26005 #[doc = "Differential pressure"]
26006 pub press_diff: f32,
26007 #[doc = "Absolute pressure temperature"]
26008 pub temperature: i16,
26009 #[doc = "Differential pressure temperature (0, if not available). Report values of 0 (or 1) as 1 cdegC."]
26010 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26011 pub temperature_press_diff: i16,
26012}
26013impl SCALED_PRESSURE3_DATA {
26014 pub const ENCODED_LEN: usize = 16usize;
26015 pub const DEFAULT: Self = Self {
26016 time_boot_ms: 0_u32,
26017 press_abs: 0.0_f32,
26018 press_diff: 0.0_f32,
26019 temperature: 0_i16,
26020 temperature_press_diff: 0_i16,
26021 };
26022 #[cfg(feature = "arbitrary")]
26023 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26024 use arbitrary::{Arbitrary, Unstructured};
26025 let mut buf = [0u8; 1024];
26026 rng.fill_bytes(&mut buf);
26027 let mut unstructured = Unstructured::new(&buf);
26028 Self::arbitrary(&mut unstructured).unwrap_or_default()
26029 }
26030}
26031impl Default for SCALED_PRESSURE3_DATA {
26032 fn default() -> Self {
26033 Self::DEFAULT.clone()
26034 }
26035}
26036impl MessageData for SCALED_PRESSURE3_DATA {
26037 type Message = MavMessage;
26038 const ID: u32 = 143u32;
26039 const NAME: &'static str = "SCALED_PRESSURE3";
26040 const EXTRA_CRC: u8 = 131u8;
26041 const ENCODED_LEN: usize = 16usize;
26042 fn deser(
26043 _version: MavlinkVersion,
26044 __input: &[u8],
26045 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26046 let avail_len = __input.len();
26047 let mut payload_buf = [0; Self::ENCODED_LEN];
26048 let mut buf = if avail_len < Self::ENCODED_LEN {
26049 payload_buf[0..avail_len].copy_from_slice(__input);
26050 Bytes::new(&payload_buf)
26051 } else {
26052 Bytes::new(__input)
26053 };
26054 let mut __struct = Self::default();
26055 __struct.time_boot_ms = buf.get_u32_le();
26056 __struct.press_abs = buf.get_f32_le();
26057 __struct.press_diff = buf.get_f32_le();
26058 __struct.temperature = buf.get_i16_le();
26059 __struct.temperature_press_diff = buf.get_i16_le();
26060 Ok(__struct)
26061 }
26062 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26063 let mut __tmp = BytesMut::new(bytes);
26064 #[allow(clippy::absurd_extreme_comparisons)]
26065 #[allow(unused_comparisons)]
26066 if __tmp.remaining() < Self::ENCODED_LEN {
26067 panic!(
26068 "buffer is too small (need {} bytes, but got {})",
26069 Self::ENCODED_LEN,
26070 __tmp.remaining(),
26071 )
26072 }
26073 __tmp.put_u32_le(self.time_boot_ms);
26074 __tmp.put_f32_le(self.press_abs);
26075 __tmp.put_f32_le(self.press_diff);
26076 __tmp.put_i16_le(self.temperature);
26077 __tmp.put_i16_le(self.temperature_press_diff);
26078 if matches!(version, MavlinkVersion::V2) {
26079 let len = __tmp.len();
26080 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26081 } else {
26082 __tmp.len()
26083 }
26084 }
26085}
26086#[doc = "id: 183"]
26087#[doc = "This message is emitted as response to SCRIPT_REQUEST_LIST by the MAV to get the number of mission scripts."]
26088#[derive(Debug, Clone, PartialEq)]
26089#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26090#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26091pub struct SCRIPT_COUNT_DATA {
26092 #[doc = "Number of script items in the sequence"]
26093 pub count: u16,
26094 #[doc = "System ID"]
26095 pub target_system: u8,
26096 #[doc = "Component ID"]
26097 pub target_component: u8,
26098}
26099impl SCRIPT_COUNT_DATA {
26100 pub const ENCODED_LEN: usize = 4usize;
26101 pub const DEFAULT: Self = Self {
26102 count: 0_u16,
26103 target_system: 0_u8,
26104 target_component: 0_u8,
26105 };
26106 #[cfg(feature = "arbitrary")]
26107 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26108 use arbitrary::{Arbitrary, Unstructured};
26109 let mut buf = [0u8; 1024];
26110 rng.fill_bytes(&mut buf);
26111 let mut unstructured = Unstructured::new(&buf);
26112 Self::arbitrary(&mut unstructured).unwrap_or_default()
26113 }
26114}
26115impl Default for SCRIPT_COUNT_DATA {
26116 fn default() -> Self {
26117 Self::DEFAULT.clone()
26118 }
26119}
26120impl MessageData for SCRIPT_COUNT_DATA {
26121 type Message = MavMessage;
26122 const ID: u32 = 183u32;
26123 const NAME: &'static str = "SCRIPT_COUNT";
26124 const EXTRA_CRC: u8 = 186u8;
26125 const ENCODED_LEN: usize = 4usize;
26126 fn deser(
26127 _version: MavlinkVersion,
26128 __input: &[u8],
26129 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26130 let avail_len = __input.len();
26131 let mut payload_buf = [0; Self::ENCODED_LEN];
26132 let mut buf = if avail_len < Self::ENCODED_LEN {
26133 payload_buf[0..avail_len].copy_from_slice(__input);
26134 Bytes::new(&payload_buf)
26135 } else {
26136 Bytes::new(__input)
26137 };
26138 let mut __struct = Self::default();
26139 __struct.count = buf.get_u16_le();
26140 __struct.target_system = buf.get_u8();
26141 __struct.target_component = buf.get_u8();
26142 Ok(__struct)
26143 }
26144 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26145 let mut __tmp = BytesMut::new(bytes);
26146 #[allow(clippy::absurd_extreme_comparisons)]
26147 #[allow(unused_comparisons)]
26148 if __tmp.remaining() < Self::ENCODED_LEN {
26149 panic!(
26150 "buffer is too small (need {} bytes, but got {})",
26151 Self::ENCODED_LEN,
26152 __tmp.remaining(),
26153 )
26154 }
26155 __tmp.put_u16_le(self.count);
26156 __tmp.put_u8(self.target_system);
26157 __tmp.put_u8(self.target_component);
26158 if matches!(version, MavlinkVersion::V2) {
26159 let len = __tmp.len();
26160 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26161 } else {
26162 __tmp.len()
26163 }
26164 }
26165}
26166#[doc = "id: 184"]
26167#[doc = "This message informs about the currently active SCRIPT."]
26168#[derive(Debug, Clone, PartialEq)]
26169#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26170#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26171pub struct SCRIPT_CURRENT_DATA {
26172 #[doc = "Active Sequence"]
26173 pub seq: u16,
26174}
26175impl SCRIPT_CURRENT_DATA {
26176 pub const ENCODED_LEN: usize = 2usize;
26177 pub const DEFAULT: Self = Self { seq: 0_u16 };
26178 #[cfg(feature = "arbitrary")]
26179 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26180 use arbitrary::{Arbitrary, Unstructured};
26181 let mut buf = [0u8; 1024];
26182 rng.fill_bytes(&mut buf);
26183 let mut unstructured = Unstructured::new(&buf);
26184 Self::arbitrary(&mut unstructured).unwrap_or_default()
26185 }
26186}
26187impl Default for SCRIPT_CURRENT_DATA {
26188 fn default() -> Self {
26189 Self::DEFAULT.clone()
26190 }
26191}
26192impl MessageData for SCRIPT_CURRENT_DATA {
26193 type Message = MavMessage;
26194 const ID: u32 = 184u32;
26195 const NAME: &'static str = "SCRIPT_CURRENT";
26196 const EXTRA_CRC: u8 = 40u8;
26197 const ENCODED_LEN: usize = 2usize;
26198 fn deser(
26199 _version: MavlinkVersion,
26200 __input: &[u8],
26201 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26202 let avail_len = __input.len();
26203 let mut payload_buf = [0; Self::ENCODED_LEN];
26204 let mut buf = if avail_len < Self::ENCODED_LEN {
26205 payload_buf[0..avail_len].copy_from_slice(__input);
26206 Bytes::new(&payload_buf)
26207 } else {
26208 Bytes::new(__input)
26209 };
26210 let mut __struct = Self::default();
26211 __struct.seq = buf.get_u16_le();
26212 Ok(__struct)
26213 }
26214 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26215 let mut __tmp = BytesMut::new(bytes);
26216 #[allow(clippy::absurd_extreme_comparisons)]
26217 #[allow(unused_comparisons)]
26218 if __tmp.remaining() < Self::ENCODED_LEN {
26219 panic!(
26220 "buffer is too small (need {} bytes, but got {})",
26221 Self::ENCODED_LEN,
26222 __tmp.remaining(),
26223 )
26224 }
26225 __tmp.put_u16_le(self.seq);
26226 if matches!(version, MavlinkVersion::V2) {
26227 let len = __tmp.len();
26228 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26229 } else {
26230 __tmp.len()
26231 }
26232 }
26233}
26234#[doc = "id: 180"]
26235#[doc = "Message encoding a mission script item. This message is emitted upon a request for the next script item."]
26236#[derive(Debug, Clone, PartialEq)]
26237#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26238#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26239pub struct SCRIPT_ITEM_DATA {
26240 #[doc = "Sequence"]
26241 pub seq: u16,
26242 #[doc = "System ID"]
26243 pub target_system: u8,
26244 #[doc = "Component ID"]
26245 pub target_component: u8,
26246 #[doc = "The name of the mission script, NULL terminated."]
26247 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
26248 pub name: [u8; 50],
26249}
26250impl SCRIPT_ITEM_DATA {
26251 pub const ENCODED_LEN: usize = 54usize;
26252 pub const DEFAULT: Self = Self {
26253 seq: 0_u16,
26254 target_system: 0_u8,
26255 target_component: 0_u8,
26256 name: [0_u8; 50usize],
26257 };
26258 #[cfg(feature = "arbitrary")]
26259 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26260 use arbitrary::{Arbitrary, Unstructured};
26261 let mut buf = [0u8; 1024];
26262 rng.fill_bytes(&mut buf);
26263 let mut unstructured = Unstructured::new(&buf);
26264 Self::arbitrary(&mut unstructured).unwrap_or_default()
26265 }
26266}
26267impl Default for SCRIPT_ITEM_DATA {
26268 fn default() -> Self {
26269 Self::DEFAULT.clone()
26270 }
26271}
26272impl MessageData for SCRIPT_ITEM_DATA {
26273 type Message = MavMessage;
26274 const ID: u32 = 180u32;
26275 const NAME: &'static str = "SCRIPT_ITEM";
26276 const EXTRA_CRC: u8 = 231u8;
26277 const ENCODED_LEN: usize = 54usize;
26278 fn deser(
26279 _version: MavlinkVersion,
26280 __input: &[u8],
26281 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26282 let avail_len = __input.len();
26283 let mut payload_buf = [0; Self::ENCODED_LEN];
26284 let mut buf = if avail_len < Self::ENCODED_LEN {
26285 payload_buf[0..avail_len].copy_from_slice(__input);
26286 Bytes::new(&payload_buf)
26287 } else {
26288 Bytes::new(__input)
26289 };
26290 let mut __struct = Self::default();
26291 __struct.seq = buf.get_u16_le();
26292 __struct.target_system = buf.get_u8();
26293 __struct.target_component = buf.get_u8();
26294 for v in &mut __struct.name {
26295 let val = buf.get_u8();
26296 *v = val;
26297 }
26298 Ok(__struct)
26299 }
26300 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26301 let mut __tmp = BytesMut::new(bytes);
26302 #[allow(clippy::absurd_extreme_comparisons)]
26303 #[allow(unused_comparisons)]
26304 if __tmp.remaining() < Self::ENCODED_LEN {
26305 panic!(
26306 "buffer is too small (need {} bytes, but got {})",
26307 Self::ENCODED_LEN,
26308 __tmp.remaining(),
26309 )
26310 }
26311 __tmp.put_u16_le(self.seq);
26312 __tmp.put_u8(self.target_system);
26313 __tmp.put_u8(self.target_component);
26314 for val in &self.name {
26315 __tmp.put_u8(*val);
26316 }
26317 if matches!(version, MavlinkVersion::V2) {
26318 let len = __tmp.len();
26319 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26320 } else {
26321 __tmp.len()
26322 }
26323 }
26324}
26325#[doc = "id: 181"]
26326#[doc = "Request script item with the sequence number seq. The response of the system to this message should be a SCRIPT_ITEM message."]
26327#[derive(Debug, Clone, PartialEq)]
26328#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26329#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26330pub struct SCRIPT_REQUEST_DATA {
26331 #[doc = "Sequence"]
26332 pub seq: u16,
26333 #[doc = "System ID"]
26334 pub target_system: u8,
26335 #[doc = "Component ID"]
26336 pub target_component: u8,
26337}
26338impl SCRIPT_REQUEST_DATA {
26339 pub const ENCODED_LEN: usize = 4usize;
26340 pub const DEFAULT: Self = Self {
26341 seq: 0_u16,
26342 target_system: 0_u8,
26343 target_component: 0_u8,
26344 };
26345 #[cfg(feature = "arbitrary")]
26346 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26347 use arbitrary::{Arbitrary, Unstructured};
26348 let mut buf = [0u8; 1024];
26349 rng.fill_bytes(&mut buf);
26350 let mut unstructured = Unstructured::new(&buf);
26351 Self::arbitrary(&mut unstructured).unwrap_or_default()
26352 }
26353}
26354impl Default for SCRIPT_REQUEST_DATA {
26355 fn default() -> Self {
26356 Self::DEFAULT.clone()
26357 }
26358}
26359impl MessageData for SCRIPT_REQUEST_DATA {
26360 type Message = MavMessage;
26361 const ID: u32 = 181u32;
26362 const NAME: &'static str = "SCRIPT_REQUEST";
26363 const EXTRA_CRC: u8 = 129u8;
26364 const ENCODED_LEN: usize = 4usize;
26365 fn deser(
26366 _version: MavlinkVersion,
26367 __input: &[u8],
26368 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26369 let avail_len = __input.len();
26370 let mut payload_buf = [0; Self::ENCODED_LEN];
26371 let mut buf = if avail_len < Self::ENCODED_LEN {
26372 payload_buf[0..avail_len].copy_from_slice(__input);
26373 Bytes::new(&payload_buf)
26374 } else {
26375 Bytes::new(__input)
26376 };
26377 let mut __struct = Self::default();
26378 __struct.seq = buf.get_u16_le();
26379 __struct.target_system = buf.get_u8();
26380 __struct.target_component = buf.get_u8();
26381 Ok(__struct)
26382 }
26383 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26384 let mut __tmp = BytesMut::new(bytes);
26385 #[allow(clippy::absurd_extreme_comparisons)]
26386 #[allow(unused_comparisons)]
26387 if __tmp.remaining() < Self::ENCODED_LEN {
26388 panic!(
26389 "buffer is too small (need {} bytes, but got {})",
26390 Self::ENCODED_LEN,
26391 __tmp.remaining(),
26392 )
26393 }
26394 __tmp.put_u16_le(self.seq);
26395 __tmp.put_u8(self.target_system);
26396 __tmp.put_u8(self.target_component);
26397 if matches!(version, MavlinkVersion::V2) {
26398 let len = __tmp.len();
26399 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26400 } else {
26401 __tmp.len()
26402 }
26403 }
26404}
26405#[doc = "id: 182"]
26406#[doc = "Request the overall list of mission items from the system/component."]
26407#[derive(Debug, Clone, PartialEq)]
26408#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26409#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26410pub struct SCRIPT_REQUEST_LIST_DATA {
26411 #[doc = "System ID"]
26412 pub target_system: u8,
26413 #[doc = "Component ID"]
26414 pub target_component: u8,
26415}
26416impl SCRIPT_REQUEST_LIST_DATA {
26417 pub const ENCODED_LEN: usize = 2usize;
26418 pub const DEFAULT: Self = Self {
26419 target_system: 0_u8,
26420 target_component: 0_u8,
26421 };
26422 #[cfg(feature = "arbitrary")]
26423 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26424 use arbitrary::{Arbitrary, Unstructured};
26425 let mut buf = [0u8; 1024];
26426 rng.fill_bytes(&mut buf);
26427 let mut unstructured = Unstructured::new(&buf);
26428 Self::arbitrary(&mut unstructured).unwrap_or_default()
26429 }
26430}
26431impl Default for SCRIPT_REQUEST_LIST_DATA {
26432 fn default() -> Self {
26433 Self::DEFAULT.clone()
26434 }
26435}
26436impl MessageData for SCRIPT_REQUEST_LIST_DATA {
26437 type Message = MavMessage;
26438 const ID: u32 = 182u32;
26439 const NAME: &'static str = "SCRIPT_REQUEST_LIST";
26440 const EXTRA_CRC: u8 = 115u8;
26441 const ENCODED_LEN: usize = 2usize;
26442 fn deser(
26443 _version: MavlinkVersion,
26444 __input: &[u8],
26445 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26446 let avail_len = __input.len();
26447 let mut payload_buf = [0; Self::ENCODED_LEN];
26448 let mut buf = if avail_len < Self::ENCODED_LEN {
26449 payload_buf[0..avail_len].copy_from_slice(__input);
26450 Bytes::new(&payload_buf)
26451 } else {
26452 Bytes::new(__input)
26453 };
26454 let mut __struct = Self::default();
26455 __struct.target_system = buf.get_u8();
26456 __struct.target_component = buf.get_u8();
26457 Ok(__struct)
26458 }
26459 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26460 let mut __tmp = BytesMut::new(bytes);
26461 #[allow(clippy::absurd_extreme_comparisons)]
26462 #[allow(unused_comparisons)]
26463 if __tmp.remaining() < Self::ENCODED_LEN {
26464 panic!(
26465 "buffer is too small (need {} bytes, but got {})",
26466 Self::ENCODED_LEN,
26467 __tmp.remaining(),
26468 )
26469 }
26470 __tmp.put_u8(self.target_system);
26471 __tmp.put_u8(self.target_component);
26472 if matches!(version, MavlinkVersion::V2) {
26473 let len = __tmp.len();
26474 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26475 } else {
26476 __tmp.len()
26477 }
26478 }
26479}
26480#[doc = "id: 126"]
26481#[doc = "Control a serial port. This can be used for raw access to an onboard serial peripheral such as a GPS or telemetry radio. It is designed to make it possible to update the devices firmware via MAVLink messages or change the devices settings. A message with zero bytes can be used to change just the baudrate."]
26482#[derive(Debug, Clone, PartialEq)]
26483#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26484#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26485pub struct SERIAL_CONTROL_DATA {
26486 #[doc = "Baudrate of transfer. Zero means no change."]
26487 pub baudrate: u32,
26488 #[doc = "Timeout for reply data"]
26489 pub timeout: u16,
26490 #[doc = "Serial control device type."]
26491 pub device: SerialControlDev,
26492 #[doc = "Bitmap of serial control flags."]
26493 pub flags: SerialControlFlag,
26494 #[doc = "how many bytes in this transfer"]
26495 pub count: u8,
26496 #[doc = "serial data"]
26497 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
26498 pub data: [u8; 70],
26499 #[doc = "System ID"]
26500 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26501 pub target_system: u8,
26502 #[doc = "Component ID"]
26503 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26504 pub target_component: u8,
26505}
26506impl SERIAL_CONTROL_DATA {
26507 pub const ENCODED_LEN: usize = 81usize;
26508 pub const DEFAULT: Self = Self {
26509 baudrate: 0_u32,
26510 timeout: 0_u16,
26511 device: SerialControlDev::DEFAULT,
26512 flags: SerialControlFlag::DEFAULT,
26513 count: 0_u8,
26514 data: [0_u8; 70usize],
26515 target_system: 0_u8,
26516 target_component: 0_u8,
26517 };
26518 #[cfg(feature = "arbitrary")]
26519 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26520 use arbitrary::{Arbitrary, Unstructured};
26521 let mut buf = [0u8; 1024];
26522 rng.fill_bytes(&mut buf);
26523 let mut unstructured = Unstructured::new(&buf);
26524 Self::arbitrary(&mut unstructured).unwrap_or_default()
26525 }
26526}
26527impl Default for SERIAL_CONTROL_DATA {
26528 fn default() -> Self {
26529 Self::DEFAULT.clone()
26530 }
26531}
26532impl MessageData for SERIAL_CONTROL_DATA {
26533 type Message = MavMessage;
26534 const ID: u32 = 126u32;
26535 const NAME: &'static str = "SERIAL_CONTROL";
26536 const EXTRA_CRC: u8 = 220u8;
26537 const ENCODED_LEN: usize = 81usize;
26538 fn deser(
26539 _version: MavlinkVersion,
26540 __input: &[u8],
26541 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26542 let avail_len = __input.len();
26543 let mut payload_buf = [0; Self::ENCODED_LEN];
26544 let mut buf = if avail_len < Self::ENCODED_LEN {
26545 payload_buf[0..avail_len].copy_from_slice(__input);
26546 Bytes::new(&payload_buf)
26547 } else {
26548 Bytes::new(__input)
26549 };
26550 let mut __struct = Self::default();
26551 __struct.baudrate = buf.get_u32_le();
26552 __struct.timeout = buf.get_u16_le();
26553 let tmp = buf.get_u8();
26554 __struct.device =
26555 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
26556 enum_type: "SerialControlDev",
26557 value: tmp as u32,
26558 })?;
26559 let tmp = buf.get_u8();
26560 __struct.flags = SerialControlFlag::from_bits(tmp & SerialControlFlag::all().bits())
26561 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
26562 flag_type: "SerialControlFlag",
26563 value: tmp as u32,
26564 })?;
26565 __struct.count = buf.get_u8();
26566 for v in &mut __struct.data {
26567 let val = buf.get_u8();
26568 *v = val;
26569 }
26570 __struct.target_system = buf.get_u8();
26571 __struct.target_component = buf.get_u8();
26572 Ok(__struct)
26573 }
26574 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26575 let mut __tmp = BytesMut::new(bytes);
26576 #[allow(clippy::absurd_extreme_comparisons)]
26577 #[allow(unused_comparisons)]
26578 if __tmp.remaining() < Self::ENCODED_LEN {
26579 panic!(
26580 "buffer is too small (need {} bytes, but got {})",
26581 Self::ENCODED_LEN,
26582 __tmp.remaining(),
26583 )
26584 }
26585 __tmp.put_u32_le(self.baudrate);
26586 __tmp.put_u16_le(self.timeout);
26587 __tmp.put_u8(self.device as u8);
26588 __tmp.put_u8(self.flags.bits());
26589 __tmp.put_u8(self.count);
26590 for val in &self.data {
26591 __tmp.put_u8(*val);
26592 }
26593 __tmp.put_u8(self.target_system);
26594 __tmp.put_u8(self.target_component);
26595 if matches!(version, MavlinkVersion::V2) {
26596 let len = __tmp.len();
26597 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26598 } else {
26599 __tmp.len()
26600 }
26601 }
26602}
26603#[doc = "id: 36"]
26604#[doc = "Superseded by ACTUATOR_OUTPUT_STATUS. The RAW values of the servo outputs (for RC input from the remote, use the RC_CHANNELS messages). The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%."]
26605#[derive(Debug, Clone, PartialEq)]
26606#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26607#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26608pub struct SERVO_OUTPUT_RAW_DATA {
26609 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
26610 pub time_usec: u32,
26611 #[doc = "Servo output 1 value"]
26612 pub servo1_raw: u16,
26613 #[doc = "Servo output 2 value"]
26614 pub servo2_raw: u16,
26615 #[doc = "Servo output 3 value"]
26616 pub servo3_raw: u16,
26617 #[doc = "Servo output 4 value"]
26618 pub servo4_raw: u16,
26619 #[doc = "Servo output 5 value"]
26620 pub servo5_raw: u16,
26621 #[doc = "Servo output 6 value"]
26622 pub servo6_raw: u16,
26623 #[doc = "Servo output 7 value"]
26624 pub servo7_raw: u16,
26625 #[doc = "Servo output 8 value"]
26626 pub servo8_raw: u16,
26627 #[doc = "Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX."]
26628 pub port: u8,
26629 #[doc = "Servo output 9 value"]
26630 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26631 pub servo9_raw: u16,
26632 #[doc = "Servo output 10 value"]
26633 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26634 pub servo10_raw: u16,
26635 #[doc = "Servo output 11 value"]
26636 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26637 pub servo11_raw: u16,
26638 #[doc = "Servo output 12 value"]
26639 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26640 pub servo12_raw: u16,
26641 #[doc = "Servo output 13 value"]
26642 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26643 pub servo13_raw: u16,
26644 #[doc = "Servo output 14 value"]
26645 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26646 pub servo14_raw: u16,
26647 #[doc = "Servo output 15 value"]
26648 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26649 pub servo15_raw: u16,
26650 #[doc = "Servo output 16 value"]
26651 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26652 pub servo16_raw: u16,
26653}
26654impl SERVO_OUTPUT_RAW_DATA {
26655 pub const ENCODED_LEN: usize = 37usize;
26656 pub const DEFAULT: Self = Self {
26657 time_usec: 0_u32,
26658 servo1_raw: 0_u16,
26659 servo2_raw: 0_u16,
26660 servo3_raw: 0_u16,
26661 servo4_raw: 0_u16,
26662 servo5_raw: 0_u16,
26663 servo6_raw: 0_u16,
26664 servo7_raw: 0_u16,
26665 servo8_raw: 0_u16,
26666 port: 0_u8,
26667 servo9_raw: 0_u16,
26668 servo10_raw: 0_u16,
26669 servo11_raw: 0_u16,
26670 servo12_raw: 0_u16,
26671 servo13_raw: 0_u16,
26672 servo14_raw: 0_u16,
26673 servo15_raw: 0_u16,
26674 servo16_raw: 0_u16,
26675 };
26676 #[cfg(feature = "arbitrary")]
26677 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26678 use arbitrary::{Arbitrary, Unstructured};
26679 let mut buf = [0u8; 1024];
26680 rng.fill_bytes(&mut buf);
26681 let mut unstructured = Unstructured::new(&buf);
26682 Self::arbitrary(&mut unstructured).unwrap_or_default()
26683 }
26684}
26685impl Default for SERVO_OUTPUT_RAW_DATA {
26686 fn default() -> Self {
26687 Self::DEFAULT.clone()
26688 }
26689}
26690impl MessageData for SERVO_OUTPUT_RAW_DATA {
26691 type Message = MavMessage;
26692 const ID: u32 = 36u32;
26693 const NAME: &'static str = "SERVO_OUTPUT_RAW";
26694 const EXTRA_CRC: u8 = 222u8;
26695 const ENCODED_LEN: usize = 37usize;
26696 fn deser(
26697 _version: MavlinkVersion,
26698 __input: &[u8],
26699 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26700 let avail_len = __input.len();
26701 let mut payload_buf = [0; Self::ENCODED_LEN];
26702 let mut buf = if avail_len < Self::ENCODED_LEN {
26703 payload_buf[0..avail_len].copy_from_slice(__input);
26704 Bytes::new(&payload_buf)
26705 } else {
26706 Bytes::new(__input)
26707 };
26708 let mut __struct = Self::default();
26709 __struct.time_usec = buf.get_u32_le();
26710 __struct.servo1_raw = buf.get_u16_le();
26711 __struct.servo2_raw = buf.get_u16_le();
26712 __struct.servo3_raw = buf.get_u16_le();
26713 __struct.servo4_raw = buf.get_u16_le();
26714 __struct.servo5_raw = buf.get_u16_le();
26715 __struct.servo6_raw = buf.get_u16_le();
26716 __struct.servo7_raw = buf.get_u16_le();
26717 __struct.servo8_raw = buf.get_u16_le();
26718 __struct.port = buf.get_u8();
26719 __struct.servo9_raw = buf.get_u16_le();
26720 __struct.servo10_raw = buf.get_u16_le();
26721 __struct.servo11_raw = buf.get_u16_le();
26722 __struct.servo12_raw = buf.get_u16_le();
26723 __struct.servo13_raw = buf.get_u16_le();
26724 __struct.servo14_raw = buf.get_u16_le();
26725 __struct.servo15_raw = buf.get_u16_le();
26726 __struct.servo16_raw = buf.get_u16_le();
26727 Ok(__struct)
26728 }
26729 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26730 let mut __tmp = BytesMut::new(bytes);
26731 #[allow(clippy::absurd_extreme_comparisons)]
26732 #[allow(unused_comparisons)]
26733 if __tmp.remaining() < Self::ENCODED_LEN {
26734 panic!(
26735 "buffer is too small (need {} bytes, but got {})",
26736 Self::ENCODED_LEN,
26737 __tmp.remaining(),
26738 )
26739 }
26740 __tmp.put_u32_le(self.time_usec);
26741 __tmp.put_u16_le(self.servo1_raw);
26742 __tmp.put_u16_le(self.servo2_raw);
26743 __tmp.put_u16_le(self.servo3_raw);
26744 __tmp.put_u16_le(self.servo4_raw);
26745 __tmp.put_u16_le(self.servo5_raw);
26746 __tmp.put_u16_le(self.servo6_raw);
26747 __tmp.put_u16_le(self.servo7_raw);
26748 __tmp.put_u16_le(self.servo8_raw);
26749 __tmp.put_u8(self.port);
26750 __tmp.put_u16_le(self.servo9_raw);
26751 __tmp.put_u16_le(self.servo10_raw);
26752 __tmp.put_u16_le(self.servo11_raw);
26753 __tmp.put_u16_le(self.servo12_raw);
26754 __tmp.put_u16_le(self.servo13_raw);
26755 __tmp.put_u16_le(self.servo14_raw);
26756 __tmp.put_u16_le(self.servo15_raw);
26757 __tmp.put_u16_le(self.servo16_raw);
26758 if matches!(version, MavlinkVersion::V2) {
26759 let len = __tmp.len();
26760 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26761 } else {
26762 __tmp.len()
26763 }
26764 }
26765}
26766#[doc = "id: 256"]
26767#[doc = "Setup a MAVLink2 signing key. If called with secret_key of all zero and zero initial_timestamp will disable signing."]
26768#[derive(Debug, Clone, PartialEq)]
26769#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26770#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26771pub struct SETUP_SIGNING_DATA {
26772 #[doc = "initial timestamp"]
26773 pub initial_timestamp: u64,
26774 #[doc = "system id of the target"]
26775 pub target_system: u8,
26776 #[doc = "component ID of the target"]
26777 pub target_component: u8,
26778 #[doc = "signing key"]
26779 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
26780 pub secret_key: [u8; 32],
26781}
26782impl SETUP_SIGNING_DATA {
26783 pub const ENCODED_LEN: usize = 42usize;
26784 pub const DEFAULT: Self = Self {
26785 initial_timestamp: 0_u64,
26786 target_system: 0_u8,
26787 target_component: 0_u8,
26788 secret_key: [0_u8; 32usize],
26789 };
26790 #[cfg(feature = "arbitrary")]
26791 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26792 use arbitrary::{Arbitrary, Unstructured};
26793 let mut buf = [0u8; 1024];
26794 rng.fill_bytes(&mut buf);
26795 let mut unstructured = Unstructured::new(&buf);
26796 Self::arbitrary(&mut unstructured).unwrap_or_default()
26797 }
26798}
26799impl Default for SETUP_SIGNING_DATA {
26800 fn default() -> Self {
26801 Self::DEFAULT.clone()
26802 }
26803}
26804impl MessageData for SETUP_SIGNING_DATA {
26805 type Message = MavMessage;
26806 const ID: u32 = 256u32;
26807 const NAME: &'static str = "SETUP_SIGNING";
26808 const EXTRA_CRC: u8 = 71u8;
26809 const ENCODED_LEN: usize = 42usize;
26810 fn deser(
26811 _version: MavlinkVersion,
26812 __input: &[u8],
26813 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26814 let avail_len = __input.len();
26815 let mut payload_buf = [0; Self::ENCODED_LEN];
26816 let mut buf = if avail_len < Self::ENCODED_LEN {
26817 payload_buf[0..avail_len].copy_from_slice(__input);
26818 Bytes::new(&payload_buf)
26819 } else {
26820 Bytes::new(__input)
26821 };
26822 let mut __struct = Self::default();
26823 __struct.initial_timestamp = buf.get_u64_le();
26824 __struct.target_system = buf.get_u8();
26825 __struct.target_component = buf.get_u8();
26826 for v in &mut __struct.secret_key {
26827 let val = buf.get_u8();
26828 *v = val;
26829 }
26830 Ok(__struct)
26831 }
26832 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26833 let mut __tmp = BytesMut::new(bytes);
26834 #[allow(clippy::absurd_extreme_comparisons)]
26835 #[allow(unused_comparisons)]
26836 if __tmp.remaining() < Self::ENCODED_LEN {
26837 panic!(
26838 "buffer is too small (need {} bytes, but got {})",
26839 Self::ENCODED_LEN,
26840 __tmp.remaining(),
26841 )
26842 }
26843 __tmp.put_u64_le(self.initial_timestamp);
26844 __tmp.put_u8(self.target_system);
26845 __tmp.put_u8(self.target_component);
26846 for val in &self.secret_key {
26847 __tmp.put_u8(*val);
26848 }
26849 if matches!(version, MavlinkVersion::V2) {
26850 let len = __tmp.len();
26851 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26852 } else {
26853 __tmp.len()
26854 }
26855 }
26856}
26857#[doc = "id: 139"]
26858#[doc = "Set the vehicle attitude and body angular rates."]
26859#[derive(Debug, Clone, PartialEq)]
26860#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26861#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26862pub struct SET_ACTUATOR_CONTROL_TARGET_DATA {
26863 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
26864 pub time_usec: u64,
26865 #[doc = "Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs."]
26866 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
26867 pub controls: [f32; 8],
26868 #[doc = "Actuator group. The \"_mlx\" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances."]
26869 pub group_mlx: u8,
26870 #[doc = "System ID"]
26871 pub target_system: u8,
26872 #[doc = "Component ID"]
26873 pub target_component: u8,
26874}
26875impl SET_ACTUATOR_CONTROL_TARGET_DATA {
26876 pub const ENCODED_LEN: usize = 43usize;
26877 pub const DEFAULT: Self = Self {
26878 time_usec: 0_u64,
26879 controls: [0.0_f32; 8usize],
26880 group_mlx: 0_u8,
26881 target_system: 0_u8,
26882 target_component: 0_u8,
26883 };
26884 #[cfg(feature = "arbitrary")]
26885 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26886 use arbitrary::{Arbitrary, Unstructured};
26887 let mut buf = [0u8; 1024];
26888 rng.fill_bytes(&mut buf);
26889 let mut unstructured = Unstructured::new(&buf);
26890 Self::arbitrary(&mut unstructured).unwrap_or_default()
26891 }
26892}
26893impl Default for SET_ACTUATOR_CONTROL_TARGET_DATA {
26894 fn default() -> Self {
26895 Self::DEFAULT.clone()
26896 }
26897}
26898impl MessageData for SET_ACTUATOR_CONTROL_TARGET_DATA {
26899 type Message = MavMessage;
26900 const ID: u32 = 139u32;
26901 const NAME: &'static str = "SET_ACTUATOR_CONTROL_TARGET";
26902 const EXTRA_CRC: u8 = 168u8;
26903 const ENCODED_LEN: usize = 43usize;
26904 fn deser(
26905 _version: MavlinkVersion,
26906 __input: &[u8],
26907 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26908 let avail_len = __input.len();
26909 let mut payload_buf = [0; Self::ENCODED_LEN];
26910 let mut buf = if avail_len < Self::ENCODED_LEN {
26911 payload_buf[0..avail_len].copy_from_slice(__input);
26912 Bytes::new(&payload_buf)
26913 } else {
26914 Bytes::new(__input)
26915 };
26916 let mut __struct = Self::default();
26917 __struct.time_usec = buf.get_u64_le();
26918 for v in &mut __struct.controls {
26919 let val = buf.get_f32_le();
26920 *v = val;
26921 }
26922 __struct.group_mlx = buf.get_u8();
26923 __struct.target_system = buf.get_u8();
26924 __struct.target_component = buf.get_u8();
26925 Ok(__struct)
26926 }
26927 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26928 let mut __tmp = BytesMut::new(bytes);
26929 #[allow(clippy::absurd_extreme_comparisons)]
26930 #[allow(unused_comparisons)]
26931 if __tmp.remaining() < Self::ENCODED_LEN {
26932 panic!(
26933 "buffer is too small (need {} bytes, but got {})",
26934 Self::ENCODED_LEN,
26935 __tmp.remaining(),
26936 )
26937 }
26938 __tmp.put_u64_le(self.time_usec);
26939 for val in &self.controls {
26940 __tmp.put_f32_le(*val);
26941 }
26942 __tmp.put_u8(self.group_mlx);
26943 __tmp.put_u8(self.target_system);
26944 __tmp.put_u8(self.target_component);
26945 if matches!(version, MavlinkVersion::V2) {
26946 let len = __tmp.len();
26947 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26948 } else {
26949 __tmp.len()
26950 }
26951 }
26952}
26953#[doc = "id: 82"]
26954#[doc = "Sets a desired vehicle attitude. Used by an external controller to command the vehicle (manual controller or other system)."]
26955#[derive(Debug, Clone, PartialEq)]
26956#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26957#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26958pub struct SET_ATTITUDE_TARGET_DATA {
26959 #[doc = "Timestamp (time since system boot)."]
26960 pub time_boot_ms: u32,
26961 #[doc = "Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0) from MAV_FRAME_LOCAL_NED to MAV_FRAME_BODY_FRD"]
26962 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
26963 pub q: [f32; 4],
26964 #[doc = "Body roll rate"]
26965 pub body_roll_rate: f32,
26966 #[doc = "Body pitch rate"]
26967 pub body_pitch_rate: f32,
26968 #[doc = "Body yaw rate"]
26969 pub body_yaw_rate: f32,
26970 #[doc = "Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust)"]
26971 pub thrust: f32,
26972 #[doc = "System ID"]
26973 pub target_system: u8,
26974 #[doc = "Component ID"]
26975 pub target_component: u8,
26976 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
26977 pub type_mask: AttitudeTargetTypemask,
26978 #[doc = "3D thrust setpoint in the body NED frame, normalized to -1 .. 1"]
26979 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26980 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
26981 pub thrust_body: [f32; 3],
26982}
26983impl SET_ATTITUDE_TARGET_DATA {
26984 pub const ENCODED_LEN: usize = 51usize;
26985 pub const DEFAULT: Self = Self {
26986 time_boot_ms: 0_u32,
26987 q: [0.0_f32; 4usize],
26988 body_roll_rate: 0.0_f32,
26989 body_pitch_rate: 0.0_f32,
26990 body_yaw_rate: 0.0_f32,
26991 thrust: 0.0_f32,
26992 target_system: 0_u8,
26993 target_component: 0_u8,
26994 type_mask: AttitudeTargetTypemask::DEFAULT,
26995 thrust_body: [0.0_f32; 3usize],
26996 };
26997 #[cfg(feature = "arbitrary")]
26998 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26999 use arbitrary::{Arbitrary, Unstructured};
27000 let mut buf = [0u8; 1024];
27001 rng.fill_bytes(&mut buf);
27002 let mut unstructured = Unstructured::new(&buf);
27003 Self::arbitrary(&mut unstructured).unwrap_or_default()
27004 }
27005}
27006impl Default for SET_ATTITUDE_TARGET_DATA {
27007 fn default() -> Self {
27008 Self::DEFAULT.clone()
27009 }
27010}
27011impl MessageData for SET_ATTITUDE_TARGET_DATA {
27012 type Message = MavMessage;
27013 const ID: u32 = 82u32;
27014 const NAME: &'static str = "SET_ATTITUDE_TARGET";
27015 const EXTRA_CRC: u8 = 49u8;
27016 const ENCODED_LEN: usize = 51usize;
27017 fn deser(
27018 _version: MavlinkVersion,
27019 __input: &[u8],
27020 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27021 let avail_len = __input.len();
27022 let mut payload_buf = [0; Self::ENCODED_LEN];
27023 let mut buf = if avail_len < Self::ENCODED_LEN {
27024 payload_buf[0..avail_len].copy_from_slice(__input);
27025 Bytes::new(&payload_buf)
27026 } else {
27027 Bytes::new(__input)
27028 };
27029 let mut __struct = Self::default();
27030 __struct.time_boot_ms = buf.get_u32_le();
27031 for v in &mut __struct.q {
27032 let val = buf.get_f32_le();
27033 *v = val;
27034 }
27035 __struct.body_roll_rate = buf.get_f32_le();
27036 __struct.body_pitch_rate = buf.get_f32_le();
27037 __struct.body_yaw_rate = buf.get_f32_le();
27038 __struct.thrust = buf.get_f32_le();
27039 __struct.target_system = buf.get_u8();
27040 __struct.target_component = buf.get_u8();
27041 let tmp = buf.get_u8();
27042 __struct.type_mask = AttitudeTargetTypemask::from_bits(
27043 tmp & AttitudeTargetTypemask::all().bits(),
27044 )
27045 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
27046 flag_type: "AttitudeTargetTypemask",
27047 value: tmp as u32,
27048 })?;
27049 for v in &mut __struct.thrust_body {
27050 let val = buf.get_f32_le();
27051 *v = val;
27052 }
27053 Ok(__struct)
27054 }
27055 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27056 let mut __tmp = BytesMut::new(bytes);
27057 #[allow(clippy::absurd_extreme_comparisons)]
27058 #[allow(unused_comparisons)]
27059 if __tmp.remaining() < Self::ENCODED_LEN {
27060 panic!(
27061 "buffer is too small (need {} bytes, but got {})",
27062 Self::ENCODED_LEN,
27063 __tmp.remaining(),
27064 )
27065 }
27066 __tmp.put_u32_le(self.time_boot_ms);
27067 for val in &self.q {
27068 __tmp.put_f32_le(*val);
27069 }
27070 __tmp.put_f32_le(self.body_roll_rate);
27071 __tmp.put_f32_le(self.body_pitch_rate);
27072 __tmp.put_f32_le(self.body_yaw_rate);
27073 __tmp.put_f32_le(self.thrust);
27074 __tmp.put_u8(self.target_system);
27075 __tmp.put_u8(self.target_component);
27076 __tmp.put_u8(self.type_mask.bits());
27077 for val in &self.thrust_body {
27078 __tmp.put_f32_le(*val);
27079 }
27080 if matches!(version, MavlinkVersion::V2) {
27081 let len = __tmp.len();
27082 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27083 } else {
27084 __tmp.len()
27085 }
27086 }
27087}
27088#[deprecated = " See `MAV_CMD_SET_GLOBAL_ORIGIN` (Deprecated since 2025-04)"]
27089#[doc = "id: 48"]
27090#[doc = "Sets the GPS coordinates of the vehicle local origin (0,0,0) position. Vehicle should emit GPS_GLOBAL_ORIGIN irrespective of whether the origin is changed. This enables transform between the local coordinate frame and the global (GPS) coordinate frame, which may be necessary when (for example) indoor and outdoor settings are connected and the MAV should move from in- to outdoor."]
27091#[derive(Debug, Clone, PartialEq)]
27092#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27093#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27094pub struct SET_GPS_GLOBAL_ORIGIN_DATA {
27095 #[doc = "Latitude (WGS84)"]
27096 pub latitude: i32,
27097 #[doc = "Longitude (WGS84)"]
27098 pub longitude: i32,
27099 #[doc = "Altitude (MSL). Positive for up."]
27100 pub altitude: i32,
27101 #[doc = "System ID"]
27102 pub target_system: u8,
27103 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
27104 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27105 pub time_usec: u64,
27106}
27107impl SET_GPS_GLOBAL_ORIGIN_DATA {
27108 pub const ENCODED_LEN: usize = 21usize;
27109 pub const DEFAULT: Self = Self {
27110 latitude: 0_i32,
27111 longitude: 0_i32,
27112 altitude: 0_i32,
27113 target_system: 0_u8,
27114 time_usec: 0_u64,
27115 };
27116 #[cfg(feature = "arbitrary")]
27117 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27118 use arbitrary::{Arbitrary, Unstructured};
27119 let mut buf = [0u8; 1024];
27120 rng.fill_bytes(&mut buf);
27121 let mut unstructured = Unstructured::new(&buf);
27122 Self::arbitrary(&mut unstructured).unwrap_or_default()
27123 }
27124}
27125impl Default for SET_GPS_GLOBAL_ORIGIN_DATA {
27126 fn default() -> Self {
27127 Self::DEFAULT.clone()
27128 }
27129}
27130impl MessageData for SET_GPS_GLOBAL_ORIGIN_DATA {
27131 type Message = MavMessage;
27132 const ID: u32 = 48u32;
27133 const NAME: &'static str = "SET_GPS_GLOBAL_ORIGIN";
27134 const EXTRA_CRC: u8 = 41u8;
27135 const ENCODED_LEN: usize = 21usize;
27136 fn deser(
27137 _version: MavlinkVersion,
27138 __input: &[u8],
27139 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27140 let avail_len = __input.len();
27141 let mut payload_buf = [0; Self::ENCODED_LEN];
27142 let mut buf = if avail_len < Self::ENCODED_LEN {
27143 payload_buf[0..avail_len].copy_from_slice(__input);
27144 Bytes::new(&payload_buf)
27145 } else {
27146 Bytes::new(__input)
27147 };
27148 let mut __struct = Self::default();
27149 __struct.latitude = buf.get_i32_le();
27150 __struct.longitude = buf.get_i32_le();
27151 __struct.altitude = buf.get_i32_le();
27152 __struct.target_system = buf.get_u8();
27153 __struct.time_usec = buf.get_u64_le();
27154 Ok(__struct)
27155 }
27156 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27157 let mut __tmp = BytesMut::new(bytes);
27158 #[allow(clippy::absurd_extreme_comparisons)]
27159 #[allow(unused_comparisons)]
27160 if __tmp.remaining() < Self::ENCODED_LEN {
27161 panic!(
27162 "buffer is too small (need {} bytes, but got {})",
27163 Self::ENCODED_LEN,
27164 __tmp.remaining(),
27165 )
27166 }
27167 __tmp.put_i32_le(self.latitude);
27168 __tmp.put_i32_le(self.longitude);
27169 __tmp.put_i32_le(self.altitude);
27170 __tmp.put_u8(self.target_system);
27171 __tmp.put_u64_le(self.time_usec);
27172 if matches!(version, MavlinkVersion::V2) {
27173 let len = __tmp.len();
27174 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27175 } else {
27176 __tmp.len()
27177 }
27178 }
27179}
27180#[deprecated = "The command protocol version (MAV_CMD_DO_SET_HOME) allows a GCS to detect when setting the home position has failed. See `MAV_CMD_DO_SET_HOME` (Deprecated since 2022-02)"]
27181#[doc = "id: 243"]
27182#[doc = "Sets the home position. \tThe home position is the default position that the system will return to and land on. The position is set automatically by the system during the takeoff (and may also be set using this message). The global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. Under normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. The approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. Note: the current home position may be emitted in a HOME_POSITION message on request (using MAV_CMD_REQUEST_MESSAGE with param1=242)."]
27183#[derive(Debug, Clone, PartialEq)]
27184#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27185#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27186pub struct SET_HOME_POSITION_DATA {
27187 #[doc = "Latitude (WGS84)"]
27188 pub latitude: i32,
27189 #[doc = "Longitude (WGS84)"]
27190 pub longitude: i32,
27191 #[doc = "Altitude (MSL). Positive for up."]
27192 pub altitude: i32,
27193 #[doc = "Local X position of this position in the local coordinate frame (NED)"]
27194 pub x: f32,
27195 #[doc = "Local Y position of this position in the local coordinate frame (NED)"]
27196 pub y: f32,
27197 #[doc = "Local Z position of this position in the local coordinate frame (NED: positive \"down\")"]
27198 pub z: f32,
27199 #[doc = "World to surface normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground"]
27200 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27201 pub q: [f32; 4],
27202 #[doc = "Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
27203 pub approach_x: f32,
27204 #[doc = "Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
27205 pub approach_y: f32,
27206 #[doc = "Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
27207 pub approach_z: f32,
27208 #[doc = "System ID."]
27209 pub target_system: u8,
27210 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
27211 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27212 pub time_usec: u64,
27213}
27214impl SET_HOME_POSITION_DATA {
27215 pub const ENCODED_LEN: usize = 61usize;
27216 pub const DEFAULT: Self = Self {
27217 latitude: 0_i32,
27218 longitude: 0_i32,
27219 altitude: 0_i32,
27220 x: 0.0_f32,
27221 y: 0.0_f32,
27222 z: 0.0_f32,
27223 q: [0.0_f32; 4usize],
27224 approach_x: 0.0_f32,
27225 approach_y: 0.0_f32,
27226 approach_z: 0.0_f32,
27227 target_system: 0_u8,
27228 time_usec: 0_u64,
27229 };
27230 #[cfg(feature = "arbitrary")]
27231 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27232 use arbitrary::{Arbitrary, Unstructured};
27233 let mut buf = [0u8; 1024];
27234 rng.fill_bytes(&mut buf);
27235 let mut unstructured = Unstructured::new(&buf);
27236 Self::arbitrary(&mut unstructured).unwrap_or_default()
27237 }
27238}
27239impl Default for SET_HOME_POSITION_DATA {
27240 fn default() -> Self {
27241 Self::DEFAULT.clone()
27242 }
27243}
27244impl MessageData for SET_HOME_POSITION_DATA {
27245 type Message = MavMessage;
27246 const ID: u32 = 243u32;
27247 const NAME: &'static str = "SET_HOME_POSITION";
27248 const EXTRA_CRC: u8 = 85u8;
27249 const ENCODED_LEN: usize = 61usize;
27250 fn deser(
27251 _version: MavlinkVersion,
27252 __input: &[u8],
27253 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27254 let avail_len = __input.len();
27255 let mut payload_buf = [0; Self::ENCODED_LEN];
27256 let mut buf = if avail_len < Self::ENCODED_LEN {
27257 payload_buf[0..avail_len].copy_from_slice(__input);
27258 Bytes::new(&payload_buf)
27259 } else {
27260 Bytes::new(__input)
27261 };
27262 let mut __struct = Self::default();
27263 __struct.latitude = buf.get_i32_le();
27264 __struct.longitude = buf.get_i32_le();
27265 __struct.altitude = buf.get_i32_le();
27266 __struct.x = buf.get_f32_le();
27267 __struct.y = buf.get_f32_le();
27268 __struct.z = buf.get_f32_le();
27269 for v in &mut __struct.q {
27270 let val = buf.get_f32_le();
27271 *v = val;
27272 }
27273 __struct.approach_x = buf.get_f32_le();
27274 __struct.approach_y = buf.get_f32_le();
27275 __struct.approach_z = buf.get_f32_le();
27276 __struct.target_system = buf.get_u8();
27277 __struct.time_usec = buf.get_u64_le();
27278 Ok(__struct)
27279 }
27280 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27281 let mut __tmp = BytesMut::new(bytes);
27282 #[allow(clippy::absurd_extreme_comparisons)]
27283 #[allow(unused_comparisons)]
27284 if __tmp.remaining() < Self::ENCODED_LEN {
27285 panic!(
27286 "buffer is too small (need {} bytes, but got {})",
27287 Self::ENCODED_LEN,
27288 __tmp.remaining(),
27289 )
27290 }
27291 __tmp.put_i32_le(self.latitude);
27292 __tmp.put_i32_le(self.longitude);
27293 __tmp.put_i32_le(self.altitude);
27294 __tmp.put_f32_le(self.x);
27295 __tmp.put_f32_le(self.y);
27296 __tmp.put_f32_le(self.z);
27297 for val in &self.q {
27298 __tmp.put_f32_le(*val);
27299 }
27300 __tmp.put_f32_le(self.approach_x);
27301 __tmp.put_f32_le(self.approach_y);
27302 __tmp.put_f32_le(self.approach_z);
27303 __tmp.put_u8(self.target_system);
27304 __tmp.put_u64_le(self.time_usec);
27305 if matches!(version, MavlinkVersion::V2) {
27306 let len = __tmp.len();
27307 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27308 } else {
27309 __tmp.len()
27310 }
27311 }
27312}
27313#[deprecated = "Use COMMAND_LONG with MAV_CMD_DO_SET_MODE instead. See `MAV_CMD_DO_SET_MODE` (Deprecated since 2015-12)"]
27314#[doc = "id: 11"]
27315#[doc = "Set the system mode, as defined by enum MAV_MODE. There is no target component id as the mode is by definition for the overall aircraft, not only for one component."]
27316#[derive(Debug, Clone, PartialEq)]
27317#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27318#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27319pub struct SET_MODE_DATA {
27320 #[doc = "The new autopilot-specific mode. This field can be ignored by an autopilot."]
27321 pub custom_mode: u32,
27322 #[doc = "The system setting the mode"]
27323 pub target_system: u8,
27324 #[doc = "The new base mode."]
27325 pub base_mode: MavMode,
27326}
27327impl SET_MODE_DATA {
27328 pub const ENCODED_LEN: usize = 6usize;
27329 pub const DEFAULT: Self = Self {
27330 custom_mode: 0_u32,
27331 target_system: 0_u8,
27332 base_mode: MavMode::DEFAULT,
27333 };
27334 #[cfg(feature = "arbitrary")]
27335 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27336 use arbitrary::{Arbitrary, Unstructured};
27337 let mut buf = [0u8; 1024];
27338 rng.fill_bytes(&mut buf);
27339 let mut unstructured = Unstructured::new(&buf);
27340 Self::arbitrary(&mut unstructured).unwrap_or_default()
27341 }
27342}
27343impl Default for SET_MODE_DATA {
27344 fn default() -> Self {
27345 Self::DEFAULT.clone()
27346 }
27347}
27348impl MessageData for SET_MODE_DATA {
27349 type Message = MavMessage;
27350 const ID: u32 = 11u32;
27351 const NAME: &'static str = "SET_MODE";
27352 const EXTRA_CRC: u8 = 89u8;
27353 const ENCODED_LEN: usize = 6usize;
27354 fn deser(
27355 _version: MavlinkVersion,
27356 __input: &[u8],
27357 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27358 let avail_len = __input.len();
27359 let mut payload_buf = [0; Self::ENCODED_LEN];
27360 let mut buf = if avail_len < Self::ENCODED_LEN {
27361 payload_buf[0..avail_len].copy_from_slice(__input);
27362 Bytes::new(&payload_buf)
27363 } else {
27364 Bytes::new(__input)
27365 };
27366 let mut __struct = Self::default();
27367 __struct.custom_mode = buf.get_u32_le();
27368 __struct.target_system = buf.get_u8();
27369 let tmp = buf.get_u8();
27370 __struct.base_mode =
27371 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
27372 enum_type: "MavMode",
27373 value: tmp as u32,
27374 })?;
27375 Ok(__struct)
27376 }
27377 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27378 let mut __tmp = BytesMut::new(bytes);
27379 #[allow(clippy::absurd_extreme_comparisons)]
27380 #[allow(unused_comparisons)]
27381 if __tmp.remaining() < Self::ENCODED_LEN {
27382 panic!(
27383 "buffer is too small (need {} bytes, but got {})",
27384 Self::ENCODED_LEN,
27385 __tmp.remaining(),
27386 )
27387 }
27388 __tmp.put_u32_le(self.custom_mode);
27389 __tmp.put_u8(self.target_system);
27390 __tmp.put_u8(self.base_mode as u8);
27391 if matches!(version, MavlinkVersion::V2) {
27392 let len = __tmp.len();
27393 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27394 } else {
27395 __tmp.len()
27396 }
27397 }
27398}
27399#[doc = "id: 86"]
27400#[doc = "Sets a desired vehicle position, velocity, and/or acceleration in a global coordinate system (WGS84). Used by an external controller to command the vehicle (manual controller or other system)."]
27401#[derive(Debug, Clone, PartialEq)]
27402#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27403#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27404pub struct SET_POSITION_TARGET_GLOBAL_INT_DATA {
27405 #[doc = "Timestamp (time since system boot). The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency."]
27406 pub time_boot_ms: u32,
27407 #[doc = "Latitude in WGS84 frame"]
27408 pub lat_int: i32,
27409 #[doc = "Longitude in WGS84 frame"]
27410 pub lon_int: i32,
27411 #[doc = "Altitude (MSL, Relative to home, or AGL - depending on frame)"]
27412 pub alt: f32,
27413 #[doc = "X velocity in NED frame"]
27414 pub vx: f32,
27415 #[doc = "Y velocity in NED frame"]
27416 pub vy: f32,
27417 #[doc = "Z velocity in NED frame"]
27418 pub vz: f32,
27419 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
27420 pub afx: f32,
27421 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
27422 pub afy: f32,
27423 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
27424 pub afz: f32,
27425 #[doc = "yaw setpoint"]
27426 pub yaw: f32,
27427 #[doc = "yaw rate setpoint"]
27428 pub yaw_rate: f32,
27429 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
27430 pub type_mask: PositionTargetTypemask,
27431 #[doc = "System ID"]
27432 pub target_system: u8,
27433 #[doc = "Component ID"]
27434 pub target_component: u8,
27435 #[doc = "Valid options are: MAV_FRAME_GLOBAL = 0, MAV_FRAME_GLOBAL_RELATIVE_ALT = 3, MAV_FRAME_GLOBAL_TERRAIN_ALT = 10 (MAV_FRAME_GLOBAL_INT, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT are allowed synonyms, but have been deprecated)"]
27436 pub coordinate_frame: MavFrame,
27437}
27438impl SET_POSITION_TARGET_GLOBAL_INT_DATA {
27439 pub const ENCODED_LEN: usize = 53usize;
27440 pub const DEFAULT: Self = Self {
27441 time_boot_ms: 0_u32,
27442 lat_int: 0_i32,
27443 lon_int: 0_i32,
27444 alt: 0.0_f32,
27445 vx: 0.0_f32,
27446 vy: 0.0_f32,
27447 vz: 0.0_f32,
27448 afx: 0.0_f32,
27449 afy: 0.0_f32,
27450 afz: 0.0_f32,
27451 yaw: 0.0_f32,
27452 yaw_rate: 0.0_f32,
27453 type_mask: PositionTargetTypemask::DEFAULT,
27454 target_system: 0_u8,
27455 target_component: 0_u8,
27456 coordinate_frame: MavFrame::DEFAULT,
27457 };
27458 #[cfg(feature = "arbitrary")]
27459 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27460 use arbitrary::{Arbitrary, Unstructured};
27461 let mut buf = [0u8; 1024];
27462 rng.fill_bytes(&mut buf);
27463 let mut unstructured = Unstructured::new(&buf);
27464 Self::arbitrary(&mut unstructured).unwrap_or_default()
27465 }
27466}
27467impl Default for SET_POSITION_TARGET_GLOBAL_INT_DATA {
27468 fn default() -> Self {
27469 Self::DEFAULT.clone()
27470 }
27471}
27472impl MessageData for SET_POSITION_TARGET_GLOBAL_INT_DATA {
27473 type Message = MavMessage;
27474 const ID: u32 = 86u32;
27475 const NAME: &'static str = "SET_POSITION_TARGET_GLOBAL_INT";
27476 const EXTRA_CRC: u8 = 5u8;
27477 const ENCODED_LEN: usize = 53usize;
27478 fn deser(
27479 _version: MavlinkVersion,
27480 __input: &[u8],
27481 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27482 let avail_len = __input.len();
27483 let mut payload_buf = [0; Self::ENCODED_LEN];
27484 let mut buf = if avail_len < Self::ENCODED_LEN {
27485 payload_buf[0..avail_len].copy_from_slice(__input);
27486 Bytes::new(&payload_buf)
27487 } else {
27488 Bytes::new(__input)
27489 };
27490 let mut __struct = Self::default();
27491 __struct.time_boot_ms = buf.get_u32_le();
27492 __struct.lat_int = buf.get_i32_le();
27493 __struct.lon_int = buf.get_i32_le();
27494 __struct.alt = buf.get_f32_le();
27495 __struct.vx = buf.get_f32_le();
27496 __struct.vy = buf.get_f32_le();
27497 __struct.vz = buf.get_f32_le();
27498 __struct.afx = buf.get_f32_le();
27499 __struct.afy = buf.get_f32_le();
27500 __struct.afz = buf.get_f32_le();
27501 __struct.yaw = buf.get_f32_le();
27502 __struct.yaw_rate = buf.get_f32_le();
27503 let tmp = buf.get_u16_le();
27504 __struct.type_mask = PositionTargetTypemask::from_bits(
27505 tmp & PositionTargetTypemask::all().bits(),
27506 )
27507 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
27508 flag_type: "PositionTargetTypemask",
27509 value: tmp as u32,
27510 })?;
27511 __struct.target_system = buf.get_u8();
27512 __struct.target_component = buf.get_u8();
27513 let tmp = buf.get_u8();
27514 __struct.coordinate_frame =
27515 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
27516 enum_type: "MavFrame",
27517 value: tmp as u32,
27518 })?;
27519 Ok(__struct)
27520 }
27521 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27522 let mut __tmp = BytesMut::new(bytes);
27523 #[allow(clippy::absurd_extreme_comparisons)]
27524 #[allow(unused_comparisons)]
27525 if __tmp.remaining() < Self::ENCODED_LEN {
27526 panic!(
27527 "buffer is too small (need {} bytes, but got {})",
27528 Self::ENCODED_LEN,
27529 __tmp.remaining(),
27530 )
27531 }
27532 __tmp.put_u32_le(self.time_boot_ms);
27533 __tmp.put_i32_le(self.lat_int);
27534 __tmp.put_i32_le(self.lon_int);
27535 __tmp.put_f32_le(self.alt);
27536 __tmp.put_f32_le(self.vx);
27537 __tmp.put_f32_le(self.vy);
27538 __tmp.put_f32_le(self.vz);
27539 __tmp.put_f32_le(self.afx);
27540 __tmp.put_f32_le(self.afy);
27541 __tmp.put_f32_le(self.afz);
27542 __tmp.put_f32_le(self.yaw);
27543 __tmp.put_f32_le(self.yaw_rate);
27544 __tmp.put_u16_le(self.type_mask.bits());
27545 __tmp.put_u8(self.target_system);
27546 __tmp.put_u8(self.target_component);
27547 __tmp.put_u8(self.coordinate_frame as u8);
27548 if matches!(version, MavlinkVersion::V2) {
27549 let len = __tmp.len();
27550 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27551 } else {
27552 __tmp.len()
27553 }
27554 }
27555}
27556#[doc = "id: 84"]
27557#[doc = "Sets a desired vehicle position in a local north-east-down coordinate frame. Used by an external controller to command the vehicle (manual controller or other system)."]
27558#[derive(Debug, Clone, PartialEq)]
27559#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27560#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27561pub struct SET_POSITION_TARGET_LOCAL_NED_DATA {
27562 #[doc = "Timestamp (time since system boot)."]
27563 pub time_boot_ms: u32,
27564 #[doc = "X Position in NED frame"]
27565 pub x: f32,
27566 #[doc = "Y Position in NED frame"]
27567 pub y: f32,
27568 #[doc = "Z Position in NED frame (note, altitude is negative in NED)"]
27569 pub z: f32,
27570 #[doc = "X velocity in NED frame"]
27571 pub vx: f32,
27572 #[doc = "Y velocity in NED frame"]
27573 pub vy: f32,
27574 #[doc = "Z velocity in NED frame"]
27575 pub vz: f32,
27576 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
27577 pub afx: f32,
27578 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
27579 pub afy: f32,
27580 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
27581 pub afz: f32,
27582 #[doc = "yaw setpoint"]
27583 pub yaw: f32,
27584 #[doc = "yaw rate setpoint"]
27585 pub yaw_rate: f32,
27586 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
27587 pub type_mask: PositionTargetTypemask,
27588 #[doc = "System ID"]
27589 pub target_system: u8,
27590 #[doc = "Component ID"]
27591 pub target_component: u8,
27592 #[doc = "Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9"]
27593 pub coordinate_frame: MavFrame,
27594}
27595impl SET_POSITION_TARGET_LOCAL_NED_DATA {
27596 pub const ENCODED_LEN: usize = 53usize;
27597 pub const DEFAULT: Self = Self {
27598 time_boot_ms: 0_u32,
27599 x: 0.0_f32,
27600 y: 0.0_f32,
27601 z: 0.0_f32,
27602 vx: 0.0_f32,
27603 vy: 0.0_f32,
27604 vz: 0.0_f32,
27605 afx: 0.0_f32,
27606 afy: 0.0_f32,
27607 afz: 0.0_f32,
27608 yaw: 0.0_f32,
27609 yaw_rate: 0.0_f32,
27610 type_mask: PositionTargetTypemask::DEFAULT,
27611 target_system: 0_u8,
27612 target_component: 0_u8,
27613 coordinate_frame: MavFrame::DEFAULT,
27614 };
27615 #[cfg(feature = "arbitrary")]
27616 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27617 use arbitrary::{Arbitrary, Unstructured};
27618 let mut buf = [0u8; 1024];
27619 rng.fill_bytes(&mut buf);
27620 let mut unstructured = Unstructured::new(&buf);
27621 Self::arbitrary(&mut unstructured).unwrap_or_default()
27622 }
27623}
27624impl Default for SET_POSITION_TARGET_LOCAL_NED_DATA {
27625 fn default() -> Self {
27626 Self::DEFAULT.clone()
27627 }
27628}
27629impl MessageData for SET_POSITION_TARGET_LOCAL_NED_DATA {
27630 type Message = MavMessage;
27631 const ID: u32 = 84u32;
27632 const NAME: &'static str = "SET_POSITION_TARGET_LOCAL_NED";
27633 const EXTRA_CRC: u8 = 143u8;
27634 const ENCODED_LEN: usize = 53usize;
27635 fn deser(
27636 _version: MavlinkVersion,
27637 __input: &[u8],
27638 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27639 let avail_len = __input.len();
27640 let mut payload_buf = [0; Self::ENCODED_LEN];
27641 let mut buf = if avail_len < Self::ENCODED_LEN {
27642 payload_buf[0..avail_len].copy_from_slice(__input);
27643 Bytes::new(&payload_buf)
27644 } else {
27645 Bytes::new(__input)
27646 };
27647 let mut __struct = Self::default();
27648 __struct.time_boot_ms = buf.get_u32_le();
27649 __struct.x = buf.get_f32_le();
27650 __struct.y = buf.get_f32_le();
27651 __struct.z = buf.get_f32_le();
27652 __struct.vx = buf.get_f32_le();
27653 __struct.vy = buf.get_f32_le();
27654 __struct.vz = buf.get_f32_le();
27655 __struct.afx = buf.get_f32_le();
27656 __struct.afy = buf.get_f32_le();
27657 __struct.afz = buf.get_f32_le();
27658 __struct.yaw = buf.get_f32_le();
27659 __struct.yaw_rate = buf.get_f32_le();
27660 let tmp = buf.get_u16_le();
27661 __struct.type_mask = PositionTargetTypemask::from_bits(
27662 tmp & PositionTargetTypemask::all().bits(),
27663 )
27664 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
27665 flag_type: "PositionTargetTypemask",
27666 value: tmp as u32,
27667 })?;
27668 __struct.target_system = buf.get_u8();
27669 __struct.target_component = buf.get_u8();
27670 let tmp = buf.get_u8();
27671 __struct.coordinate_frame =
27672 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
27673 enum_type: "MavFrame",
27674 value: tmp as u32,
27675 })?;
27676 Ok(__struct)
27677 }
27678 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27679 let mut __tmp = BytesMut::new(bytes);
27680 #[allow(clippy::absurd_extreme_comparisons)]
27681 #[allow(unused_comparisons)]
27682 if __tmp.remaining() < Self::ENCODED_LEN {
27683 panic!(
27684 "buffer is too small (need {} bytes, but got {})",
27685 Self::ENCODED_LEN,
27686 __tmp.remaining(),
27687 )
27688 }
27689 __tmp.put_u32_le(self.time_boot_ms);
27690 __tmp.put_f32_le(self.x);
27691 __tmp.put_f32_le(self.y);
27692 __tmp.put_f32_le(self.z);
27693 __tmp.put_f32_le(self.vx);
27694 __tmp.put_f32_le(self.vy);
27695 __tmp.put_f32_le(self.vz);
27696 __tmp.put_f32_le(self.afx);
27697 __tmp.put_f32_le(self.afy);
27698 __tmp.put_f32_le(self.afz);
27699 __tmp.put_f32_le(self.yaw);
27700 __tmp.put_f32_le(self.yaw_rate);
27701 __tmp.put_u16_le(self.type_mask.bits());
27702 __tmp.put_u8(self.target_system);
27703 __tmp.put_u8(self.target_component);
27704 __tmp.put_u8(self.coordinate_frame as u8);
27705 if matches!(version, MavlinkVersion::V2) {
27706 let len = __tmp.len();
27707 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27708 } else {
27709 __tmp.len()
27710 }
27711 }
27712}
27713#[doc = "id: 108"]
27714#[doc = "Status of simulation environment, if used."]
27715#[derive(Debug, Clone, PartialEq)]
27716#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27717#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27718pub struct SIM_STATE_DATA {
27719 #[doc = "True attitude quaternion component 1, w (1 in null-rotation)"]
27720 pub q1: f32,
27721 #[doc = "True attitude quaternion component 2, x (0 in null-rotation)"]
27722 pub q2: f32,
27723 #[doc = "True attitude quaternion component 3, y (0 in null-rotation)"]
27724 pub q3: f32,
27725 #[doc = "True attitude quaternion component 4, z (0 in null-rotation)"]
27726 pub q4: f32,
27727 #[doc = "Attitude roll expressed as Euler angles, not recommended except for human-readable outputs"]
27728 pub roll: f32,
27729 #[doc = "Attitude pitch expressed as Euler angles, not recommended except for human-readable outputs"]
27730 pub pitch: f32,
27731 #[doc = "Attitude yaw expressed as Euler angles, not recommended except for human-readable outputs"]
27732 pub yaw: f32,
27733 #[doc = "X acceleration"]
27734 pub xacc: f32,
27735 #[doc = "Y acceleration"]
27736 pub yacc: f32,
27737 #[doc = "Z acceleration"]
27738 pub zacc: f32,
27739 #[doc = "Angular speed around X axis"]
27740 pub xgyro: f32,
27741 #[doc = "Angular speed around Y axis"]
27742 pub ygyro: f32,
27743 #[doc = "Angular speed around Z axis"]
27744 pub zgyro: f32,
27745 #[doc = "Latitude (lower precision). Both this and the lat_int field should be set."]
27746 pub lat: f32,
27747 #[doc = "Longitude (lower precision). Both this and the lon_int field should be set."]
27748 pub lon: f32,
27749 #[doc = "Altitude"]
27750 pub alt: f32,
27751 #[doc = "Horizontal position standard deviation"]
27752 pub std_dev_horz: f32,
27753 #[doc = "Vertical position standard deviation"]
27754 pub std_dev_vert: f32,
27755 #[doc = "True velocity in north direction in earth-fixed NED frame"]
27756 pub vn: f32,
27757 #[doc = "True velocity in east direction in earth-fixed NED frame"]
27758 pub ve: f32,
27759 #[doc = "True velocity in down direction in earth-fixed NED frame"]
27760 pub vd: f32,
27761 #[doc = "Latitude (higher precision). If 0, recipients should use the lat field value (otherwise this field is preferred)."]
27762 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27763 pub lat_int: i32,
27764 #[doc = "Longitude (higher precision). If 0, recipients should use the lon field value (otherwise this field is preferred)."]
27765 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27766 pub lon_int: i32,
27767}
27768impl SIM_STATE_DATA {
27769 pub const ENCODED_LEN: usize = 92usize;
27770 pub const DEFAULT: Self = Self {
27771 q1: 0.0_f32,
27772 q2: 0.0_f32,
27773 q3: 0.0_f32,
27774 q4: 0.0_f32,
27775 roll: 0.0_f32,
27776 pitch: 0.0_f32,
27777 yaw: 0.0_f32,
27778 xacc: 0.0_f32,
27779 yacc: 0.0_f32,
27780 zacc: 0.0_f32,
27781 xgyro: 0.0_f32,
27782 ygyro: 0.0_f32,
27783 zgyro: 0.0_f32,
27784 lat: 0.0_f32,
27785 lon: 0.0_f32,
27786 alt: 0.0_f32,
27787 std_dev_horz: 0.0_f32,
27788 std_dev_vert: 0.0_f32,
27789 vn: 0.0_f32,
27790 ve: 0.0_f32,
27791 vd: 0.0_f32,
27792 lat_int: 0_i32,
27793 lon_int: 0_i32,
27794 };
27795 #[cfg(feature = "arbitrary")]
27796 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27797 use arbitrary::{Arbitrary, Unstructured};
27798 let mut buf = [0u8; 1024];
27799 rng.fill_bytes(&mut buf);
27800 let mut unstructured = Unstructured::new(&buf);
27801 Self::arbitrary(&mut unstructured).unwrap_or_default()
27802 }
27803}
27804impl Default for SIM_STATE_DATA {
27805 fn default() -> Self {
27806 Self::DEFAULT.clone()
27807 }
27808}
27809impl MessageData for SIM_STATE_DATA {
27810 type Message = MavMessage;
27811 const ID: u32 = 108u32;
27812 const NAME: &'static str = "SIM_STATE";
27813 const EXTRA_CRC: u8 = 32u8;
27814 const ENCODED_LEN: usize = 92usize;
27815 fn deser(
27816 _version: MavlinkVersion,
27817 __input: &[u8],
27818 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27819 let avail_len = __input.len();
27820 let mut payload_buf = [0; Self::ENCODED_LEN];
27821 let mut buf = if avail_len < Self::ENCODED_LEN {
27822 payload_buf[0..avail_len].copy_from_slice(__input);
27823 Bytes::new(&payload_buf)
27824 } else {
27825 Bytes::new(__input)
27826 };
27827 let mut __struct = Self::default();
27828 __struct.q1 = buf.get_f32_le();
27829 __struct.q2 = buf.get_f32_le();
27830 __struct.q3 = buf.get_f32_le();
27831 __struct.q4 = buf.get_f32_le();
27832 __struct.roll = buf.get_f32_le();
27833 __struct.pitch = buf.get_f32_le();
27834 __struct.yaw = buf.get_f32_le();
27835 __struct.xacc = buf.get_f32_le();
27836 __struct.yacc = buf.get_f32_le();
27837 __struct.zacc = buf.get_f32_le();
27838 __struct.xgyro = buf.get_f32_le();
27839 __struct.ygyro = buf.get_f32_le();
27840 __struct.zgyro = buf.get_f32_le();
27841 __struct.lat = buf.get_f32_le();
27842 __struct.lon = buf.get_f32_le();
27843 __struct.alt = buf.get_f32_le();
27844 __struct.std_dev_horz = buf.get_f32_le();
27845 __struct.std_dev_vert = buf.get_f32_le();
27846 __struct.vn = buf.get_f32_le();
27847 __struct.ve = buf.get_f32_le();
27848 __struct.vd = buf.get_f32_le();
27849 __struct.lat_int = buf.get_i32_le();
27850 __struct.lon_int = buf.get_i32_le();
27851 Ok(__struct)
27852 }
27853 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27854 let mut __tmp = BytesMut::new(bytes);
27855 #[allow(clippy::absurd_extreme_comparisons)]
27856 #[allow(unused_comparisons)]
27857 if __tmp.remaining() < Self::ENCODED_LEN {
27858 panic!(
27859 "buffer is too small (need {} bytes, but got {})",
27860 Self::ENCODED_LEN,
27861 __tmp.remaining(),
27862 )
27863 }
27864 __tmp.put_f32_le(self.q1);
27865 __tmp.put_f32_le(self.q2);
27866 __tmp.put_f32_le(self.q3);
27867 __tmp.put_f32_le(self.q4);
27868 __tmp.put_f32_le(self.roll);
27869 __tmp.put_f32_le(self.pitch);
27870 __tmp.put_f32_le(self.yaw);
27871 __tmp.put_f32_le(self.xacc);
27872 __tmp.put_f32_le(self.yacc);
27873 __tmp.put_f32_le(self.zacc);
27874 __tmp.put_f32_le(self.xgyro);
27875 __tmp.put_f32_le(self.ygyro);
27876 __tmp.put_f32_le(self.zgyro);
27877 __tmp.put_f32_le(self.lat);
27878 __tmp.put_f32_le(self.lon);
27879 __tmp.put_f32_le(self.alt);
27880 __tmp.put_f32_le(self.std_dev_horz);
27881 __tmp.put_f32_le(self.std_dev_vert);
27882 __tmp.put_f32_le(self.vn);
27883 __tmp.put_f32_le(self.ve);
27884 __tmp.put_f32_le(self.vd);
27885 __tmp.put_i32_le(self.lat_int);
27886 __tmp.put_i32_le(self.lon_int);
27887 if matches!(version, MavlinkVersion::V2) {
27888 let len = __tmp.len();
27889 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27890 } else {
27891 __tmp.len()
27892 }
27893 }
27894}
27895#[deprecated = "The BATTERY_INFO message is better aligned with UAVCAN messages, and in any case is useful even if a battery is not \"smart\". See `BATTERY_INFO` (Deprecated since 2024-02)"]
27896#[doc = "id: 370"]
27897#[doc = "Smart Battery information (static/infrequent update). Use for updates from: smart battery to flight stack, flight stack to GCS. Use BATTERY_STATUS for the frequent battery updates."]
27898#[derive(Debug, Clone, PartialEq)]
27899#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27900#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27901pub struct SMART_BATTERY_INFO_DATA {
27902 #[doc = "Capacity when full according to manufacturer, -1: field not provided."]
27903 pub capacity_full_specification: i32,
27904 #[doc = "Capacity when full (accounting for battery degradation), -1: field not provided."]
27905 pub capacity_full: i32,
27906 #[doc = "Charge/discharge cycle count. UINT16_MAX: field not provided."]
27907 pub cycle_count: u16,
27908 #[doc = "Battery weight. 0: field not provided."]
27909 pub weight: u16,
27910 #[doc = "Minimum per-cell voltage when discharging. If not supplied set to UINT16_MAX value."]
27911 pub discharge_minimum_voltage: u16,
27912 #[doc = "Minimum per-cell voltage when charging. If not supplied set to UINT16_MAX value."]
27913 pub charging_minimum_voltage: u16,
27914 #[doc = "Minimum per-cell voltage when resting. If not supplied set to UINT16_MAX value."]
27915 pub resting_minimum_voltage: u16,
27916 #[doc = "Battery ID"]
27917 pub id: u8,
27918 #[doc = "Function of the battery"]
27919 pub battery_function: MavBatteryFunction,
27920 #[doc = "Type (chemistry) of the battery"]
27921 pub mavtype: MavBatteryType,
27922 #[doc = "Serial number in ASCII characters, 0 terminated. All 0: field not provided."]
27923 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27924 pub serial_number: [u8; 16],
27925 #[doc = "Static device name in ASCII characters, 0 terminated. All 0: field not provided. Encode as manufacturer name then product name separated using an underscore."]
27926 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27927 pub device_name: [u8; 50],
27928 #[doc = "Maximum per-cell voltage when charged. 0: field not provided."]
27929 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27930 pub charging_maximum_voltage: u16,
27931 #[doc = "Number of battery cells in series. 0: field not provided."]
27932 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27933 pub cells_in_series: u8,
27934 #[doc = "Maximum pack discharge current. 0: field not provided."]
27935 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27936 pub discharge_maximum_current: u32,
27937 #[doc = "Maximum pack discharge burst current. 0: field not provided."]
27938 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27939 pub discharge_maximum_burst_current: u32,
27940 #[doc = "Manufacture date (DD/MM/YYYY) in ASCII characters, 0 terminated. All 0: field not provided."]
27941 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27942 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27943 pub manufacture_date: [u8; 11],
27944}
27945impl SMART_BATTERY_INFO_DATA {
27946 pub const ENCODED_LEN: usize = 109usize;
27947 pub const DEFAULT: Self = Self {
27948 capacity_full_specification: 0_i32,
27949 capacity_full: 0_i32,
27950 cycle_count: 0_u16,
27951 weight: 0_u16,
27952 discharge_minimum_voltage: 0_u16,
27953 charging_minimum_voltage: 0_u16,
27954 resting_minimum_voltage: 0_u16,
27955 id: 0_u8,
27956 battery_function: MavBatteryFunction::DEFAULT,
27957 mavtype: MavBatteryType::DEFAULT,
27958 serial_number: [0_u8; 16usize],
27959 device_name: [0_u8; 50usize],
27960 charging_maximum_voltage: 0_u16,
27961 cells_in_series: 0_u8,
27962 discharge_maximum_current: 0_u32,
27963 discharge_maximum_burst_current: 0_u32,
27964 manufacture_date: [0_u8; 11usize],
27965 };
27966 #[cfg(feature = "arbitrary")]
27967 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27968 use arbitrary::{Arbitrary, Unstructured};
27969 let mut buf = [0u8; 1024];
27970 rng.fill_bytes(&mut buf);
27971 let mut unstructured = Unstructured::new(&buf);
27972 Self::arbitrary(&mut unstructured).unwrap_or_default()
27973 }
27974}
27975impl Default for SMART_BATTERY_INFO_DATA {
27976 fn default() -> Self {
27977 Self::DEFAULT.clone()
27978 }
27979}
27980impl MessageData for SMART_BATTERY_INFO_DATA {
27981 type Message = MavMessage;
27982 const ID: u32 = 370u32;
27983 const NAME: &'static str = "SMART_BATTERY_INFO";
27984 const EXTRA_CRC: u8 = 75u8;
27985 const ENCODED_LEN: usize = 109usize;
27986 fn deser(
27987 _version: MavlinkVersion,
27988 __input: &[u8],
27989 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27990 let avail_len = __input.len();
27991 let mut payload_buf = [0; Self::ENCODED_LEN];
27992 let mut buf = if avail_len < Self::ENCODED_LEN {
27993 payload_buf[0..avail_len].copy_from_slice(__input);
27994 Bytes::new(&payload_buf)
27995 } else {
27996 Bytes::new(__input)
27997 };
27998 let mut __struct = Self::default();
27999 __struct.capacity_full_specification = buf.get_i32_le();
28000 __struct.capacity_full = buf.get_i32_le();
28001 __struct.cycle_count = buf.get_u16_le();
28002 __struct.weight = buf.get_u16_le();
28003 __struct.discharge_minimum_voltage = buf.get_u16_le();
28004 __struct.charging_minimum_voltage = buf.get_u16_le();
28005 __struct.resting_minimum_voltage = buf.get_u16_le();
28006 __struct.id = buf.get_u8();
28007 let tmp = buf.get_u8();
28008 __struct.battery_function =
28009 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28010 enum_type: "MavBatteryFunction",
28011 value: tmp as u32,
28012 })?;
28013 let tmp = buf.get_u8();
28014 __struct.mavtype =
28015 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28016 enum_type: "MavBatteryType",
28017 value: tmp as u32,
28018 })?;
28019 for v in &mut __struct.serial_number {
28020 let val = buf.get_u8();
28021 *v = val;
28022 }
28023 for v in &mut __struct.device_name {
28024 let val = buf.get_u8();
28025 *v = val;
28026 }
28027 __struct.charging_maximum_voltage = buf.get_u16_le();
28028 __struct.cells_in_series = buf.get_u8();
28029 __struct.discharge_maximum_current = buf.get_u32_le();
28030 __struct.discharge_maximum_burst_current = buf.get_u32_le();
28031 for v in &mut __struct.manufacture_date {
28032 let val = buf.get_u8();
28033 *v = val;
28034 }
28035 Ok(__struct)
28036 }
28037 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28038 let mut __tmp = BytesMut::new(bytes);
28039 #[allow(clippy::absurd_extreme_comparisons)]
28040 #[allow(unused_comparisons)]
28041 if __tmp.remaining() < Self::ENCODED_LEN {
28042 panic!(
28043 "buffer is too small (need {} bytes, but got {})",
28044 Self::ENCODED_LEN,
28045 __tmp.remaining(),
28046 )
28047 }
28048 __tmp.put_i32_le(self.capacity_full_specification);
28049 __tmp.put_i32_le(self.capacity_full);
28050 __tmp.put_u16_le(self.cycle_count);
28051 __tmp.put_u16_le(self.weight);
28052 __tmp.put_u16_le(self.discharge_minimum_voltage);
28053 __tmp.put_u16_le(self.charging_minimum_voltage);
28054 __tmp.put_u16_le(self.resting_minimum_voltage);
28055 __tmp.put_u8(self.id);
28056 __tmp.put_u8(self.battery_function as u8);
28057 __tmp.put_u8(self.mavtype as u8);
28058 for val in &self.serial_number {
28059 __tmp.put_u8(*val);
28060 }
28061 for val in &self.device_name {
28062 __tmp.put_u8(*val);
28063 }
28064 __tmp.put_u16_le(self.charging_maximum_voltage);
28065 __tmp.put_u8(self.cells_in_series);
28066 __tmp.put_u32_le(self.discharge_maximum_current);
28067 __tmp.put_u32_le(self.discharge_maximum_burst_current);
28068 for val in &self.manufacture_date {
28069 __tmp.put_u8(*val);
28070 }
28071 if matches!(version, MavlinkVersion::V2) {
28072 let len = __tmp.len();
28073 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28074 } else {
28075 __tmp.len()
28076 }
28077 }
28078}
28079#[doc = "id: 253"]
28080#[doc = "Status text message. These messages are printed in yellow in the COMM console of QGroundControl. WARNING: They consume quite some bandwidth, so use only for important status and error messages. If implemented wisely, these messages are buffered on the MCU and sent only at a limited rate (e.g. 10 Hz)."]
28081#[derive(Debug, Clone, PartialEq)]
28082#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28083#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28084pub struct STATUSTEXT_DATA {
28085 #[doc = "Severity of status. Relies on the definitions within RFC-5424."]
28086 pub severity: MavSeverity,
28087 #[doc = "Status text message, without null termination character"]
28088 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28089 pub text: [u8; 50],
28090 #[doc = "Unique (opaque) identifier for this statustext message. May be used to reassemble a logical long-statustext message from a sequence of chunks. A value of zero indicates this is the only chunk in the sequence and the message can be emitted immediately."]
28091 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28092 pub id: u16,
28093 #[doc = "This chunk's sequence number; indexing is from zero. Any null character in the text field is taken to mean this was the last chunk."]
28094 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28095 pub chunk_seq: u8,
28096}
28097impl STATUSTEXT_DATA {
28098 pub const ENCODED_LEN: usize = 54usize;
28099 pub const DEFAULT: Self = Self {
28100 severity: MavSeverity::DEFAULT,
28101 text: [0_u8; 50usize],
28102 id: 0_u16,
28103 chunk_seq: 0_u8,
28104 };
28105 #[cfg(feature = "arbitrary")]
28106 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28107 use arbitrary::{Arbitrary, Unstructured};
28108 let mut buf = [0u8; 1024];
28109 rng.fill_bytes(&mut buf);
28110 let mut unstructured = Unstructured::new(&buf);
28111 Self::arbitrary(&mut unstructured).unwrap_or_default()
28112 }
28113}
28114impl Default for STATUSTEXT_DATA {
28115 fn default() -> Self {
28116 Self::DEFAULT.clone()
28117 }
28118}
28119impl MessageData for STATUSTEXT_DATA {
28120 type Message = MavMessage;
28121 const ID: u32 = 253u32;
28122 const NAME: &'static str = "STATUSTEXT";
28123 const EXTRA_CRC: u8 = 83u8;
28124 const ENCODED_LEN: usize = 54usize;
28125 fn deser(
28126 _version: MavlinkVersion,
28127 __input: &[u8],
28128 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28129 let avail_len = __input.len();
28130 let mut payload_buf = [0; Self::ENCODED_LEN];
28131 let mut buf = if avail_len < Self::ENCODED_LEN {
28132 payload_buf[0..avail_len].copy_from_slice(__input);
28133 Bytes::new(&payload_buf)
28134 } else {
28135 Bytes::new(__input)
28136 };
28137 let mut __struct = Self::default();
28138 let tmp = buf.get_u8();
28139 __struct.severity =
28140 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28141 enum_type: "MavSeverity",
28142 value: tmp as u32,
28143 })?;
28144 for v in &mut __struct.text {
28145 let val = buf.get_u8();
28146 *v = val;
28147 }
28148 __struct.id = buf.get_u16_le();
28149 __struct.chunk_seq = buf.get_u8();
28150 Ok(__struct)
28151 }
28152 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28153 let mut __tmp = BytesMut::new(bytes);
28154 #[allow(clippy::absurd_extreme_comparisons)]
28155 #[allow(unused_comparisons)]
28156 if __tmp.remaining() < Self::ENCODED_LEN {
28157 panic!(
28158 "buffer is too small (need {} bytes, but got {})",
28159 Self::ENCODED_LEN,
28160 __tmp.remaining(),
28161 )
28162 }
28163 __tmp.put_u8(self.severity as u8);
28164 for val in &self.text {
28165 __tmp.put_u8(*val);
28166 }
28167 __tmp.put_u16_le(self.id);
28168 __tmp.put_u8(self.chunk_seq);
28169 if matches!(version, MavlinkVersion::V2) {
28170 let len = __tmp.len();
28171 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28172 } else {
28173 __tmp.len()
28174 }
28175 }
28176}
28177#[doc = "id: 261"]
28178#[doc = "Information about a storage medium. This message is sent in response to a request with MAV_CMD_REQUEST_MESSAGE and whenever the status of the storage changes (STORAGE_STATUS). Use MAV_CMD_REQUEST_MESSAGE.param2 to indicate the index/id of requested storage: 0 for all, 1 for first, 2 for second, etc."]
28179#[derive(Debug, Clone, PartialEq)]
28180#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28181#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28182pub struct STORAGE_INFORMATION_DATA {
28183 #[doc = "Timestamp (time since system boot)."]
28184 pub time_boot_ms: u32,
28185 #[doc = "Total capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored."]
28186 pub total_capacity: f32,
28187 #[doc = "Used capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored."]
28188 pub used_capacity: f32,
28189 #[doc = "Available storage capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored."]
28190 pub available_capacity: f32,
28191 #[doc = "Read speed."]
28192 pub read_speed: f32,
28193 #[doc = "Write speed."]
28194 pub write_speed: f32,
28195 #[doc = "Storage ID (1 for first, 2 for second, etc.)"]
28196 pub storage_id: u8,
28197 #[doc = "Number of storage devices"]
28198 pub storage_count: u8,
28199 #[doc = "Status of storage"]
28200 pub status: StorageStatus,
28201 #[doc = "Type of storage"]
28202 #[cfg_attr(feature = "serde", serde(default))]
28203 pub mavtype: StorageType,
28204 #[doc = "Textual storage name to be used in UI (microSD 1, Internal Memory, etc.) This is a NULL terminated string. If it is exactly 32 characters long, add a terminating NULL. If this string is empty, the generic type is shown to the user."]
28205 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28206 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28207 pub name: [u8; 32],
28208 #[doc = "Flags indicating whether this instance is preferred storage for photos, videos, etc. Note: Implementations should initially set the flags on the system-default storage id used for saving media (if possible/supported). This setting can then be overridden using MAV_CMD_SET_STORAGE_USAGE. If the media usage flags are not set, a GCS may assume storage ID 1 is the default storage for all media types."]
28209 #[cfg_attr(feature = "serde", serde(default))]
28210 pub storage_usage: StorageUsageFlag,
28211}
28212impl STORAGE_INFORMATION_DATA {
28213 pub const ENCODED_LEN: usize = 61usize;
28214 pub const DEFAULT: Self = Self {
28215 time_boot_ms: 0_u32,
28216 total_capacity: 0.0_f32,
28217 used_capacity: 0.0_f32,
28218 available_capacity: 0.0_f32,
28219 read_speed: 0.0_f32,
28220 write_speed: 0.0_f32,
28221 storage_id: 0_u8,
28222 storage_count: 0_u8,
28223 status: StorageStatus::DEFAULT,
28224 mavtype: StorageType::DEFAULT,
28225 name: [0_u8; 32usize],
28226 storage_usage: StorageUsageFlag::DEFAULT,
28227 };
28228 #[cfg(feature = "arbitrary")]
28229 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28230 use arbitrary::{Arbitrary, Unstructured};
28231 let mut buf = [0u8; 1024];
28232 rng.fill_bytes(&mut buf);
28233 let mut unstructured = Unstructured::new(&buf);
28234 Self::arbitrary(&mut unstructured).unwrap_or_default()
28235 }
28236}
28237impl Default for STORAGE_INFORMATION_DATA {
28238 fn default() -> Self {
28239 Self::DEFAULT.clone()
28240 }
28241}
28242impl MessageData for STORAGE_INFORMATION_DATA {
28243 type Message = MavMessage;
28244 const ID: u32 = 261u32;
28245 const NAME: &'static str = "STORAGE_INFORMATION";
28246 const EXTRA_CRC: u8 = 179u8;
28247 const ENCODED_LEN: usize = 61usize;
28248 fn deser(
28249 _version: MavlinkVersion,
28250 __input: &[u8],
28251 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28252 let avail_len = __input.len();
28253 let mut payload_buf = [0; Self::ENCODED_LEN];
28254 let mut buf = if avail_len < Self::ENCODED_LEN {
28255 payload_buf[0..avail_len].copy_from_slice(__input);
28256 Bytes::new(&payload_buf)
28257 } else {
28258 Bytes::new(__input)
28259 };
28260 let mut __struct = Self::default();
28261 __struct.time_boot_ms = buf.get_u32_le();
28262 __struct.total_capacity = buf.get_f32_le();
28263 __struct.used_capacity = buf.get_f32_le();
28264 __struct.available_capacity = buf.get_f32_le();
28265 __struct.read_speed = buf.get_f32_le();
28266 __struct.write_speed = buf.get_f32_le();
28267 __struct.storage_id = buf.get_u8();
28268 __struct.storage_count = buf.get_u8();
28269 let tmp = buf.get_u8();
28270 __struct.status =
28271 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28272 enum_type: "StorageStatus",
28273 value: tmp as u32,
28274 })?;
28275 let tmp = buf.get_u8();
28276 __struct.mavtype =
28277 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28278 enum_type: "StorageType",
28279 value: tmp as u32,
28280 })?;
28281 for v in &mut __struct.name {
28282 let val = buf.get_u8();
28283 *v = val;
28284 }
28285 let tmp = buf.get_u8();
28286 __struct.storage_usage = StorageUsageFlag::from_bits(tmp & StorageUsageFlag::all().bits())
28287 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
28288 flag_type: "StorageUsageFlag",
28289 value: tmp as u32,
28290 })?;
28291 Ok(__struct)
28292 }
28293 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28294 let mut __tmp = BytesMut::new(bytes);
28295 #[allow(clippy::absurd_extreme_comparisons)]
28296 #[allow(unused_comparisons)]
28297 if __tmp.remaining() < Self::ENCODED_LEN {
28298 panic!(
28299 "buffer is too small (need {} bytes, but got {})",
28300 Self::ENCODED_LEN,
28301 __tmp.remaining(),
28302 )
28303 }
28304 __tmp.put_u32_le(self.time_boot_ms);
28305 __tmp.put_f32_le(self.total_capacity);
28306 __tmp.put_f32_le(self.used_capacity);
28307 __tmp.put_f32_le(self.available_capacity);
28308 __tmp.put_f32_le(self.read_speed);
28309 __tmp.put_f32_le(self.write_speed);
28310 __tmp.put_u8(self.storage_id);
28311 __tmp.put_u8(self.storage_count);
28312 __tmp.put_u8(self.status as u8);
28313 __tmp.put_u8(self.mavtype as u8);
28314 for val in &self.name {
28315 __tmp.put_u8(*val);
28316 }
28317 __tmp.put_u8(self.storage_usage.bits());
28318 if matches!(version, MavlinkVersion::V2) {
28319 let len = __tmp.len();
28320 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28321 } else {
28322 __tmp.len()
28323 }
28324 }
28325}
28326#[doc = "id: 401"]
28327#[doc = "Tune formats supported by vehicle. This should be emitted as response to MAV_CMD_REQUEST_MESSAGE."]
28328#[derive(Debug, Clone, PartialEq)]
28329#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28330#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28331pub struct SUPPORTED_TUNES_DATA {
28332 #[doc = "Bitfield of supported tune formats."]
28333 pub format: TuneFormat,
28334 #[doc = "System ID"]
28335 pub target_system: u8,
28336 #[doc = "Component ID"]
28337 pub target_component: u8,
28338}
28339impl SUPPORTED_TUNES_DATA {
28340 pub const ENCODED_LEN: usize = 6usize;
28341 pub const DEFAULT: Self = Self {
28342 format: TuneFormat::DEFAULT,
28343 target_system: 0_u8,
28344 target_component: 0_u8,
28345 };
28346 #[cfg(feature = "arbitrary")]
28347 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28348 use arbitrary::{Arbitrary, Unstructured};
28349 let mut buf = [0u8; 1024];
28350 rng.fill_bytes(&mut buf);
28351 let mut unstructured = Unstructured::new(&buf);
28352 Self::arbitrary(&mut unstructured).unwrap_or_default()
28353 }
28354}
28355impl Default for SUPPORTED_TUNES_DATA {
28356 fn default() -> Self {
28357 Self::DEFAULT.clone()
28358 }
28359}
28360impl MessageData for SUPPORTED_TUNES_DATA {
28361 type Message = MavMessage;
28362 const ID: u32 = 401u32;
28363 const NAME: &'static str = "SUPPORTED_TUNES";
28364 const EXTRA_CRC: u8 = 183u8;
28365 const ENCODED_LEN: usize = 6usize;
28366 fn deser(
28367 _version: MavlinkVersion,
28368 __input: &[u8],
28369 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28370 let avail_len = __input.len();
28371 let mut payload_buf = [0; Self::ENCODED_LEN];
28372 let mut buf = if avail_len < Self::ENCODED_LEN {
28373 payload_buf[0..avail_len].copy_from_slice(__input);
28374 Bytes::new(&payload_buf)
28375 } else {
28376 Bytes::new(__input)
28377 };
28378 let mut __struct = Self::default();
28379 let tmp = buf.get_u32_le();
28380 __struct.format = FromPrimitive::from_u32(tmp).ok_or(
28381 ::mavlink_core::error::ParserError::InvalidEnum {
28382 enum_type: "TuneFormat",
28383 value: tmp as u32,
28384 },
28385 )?;
28386 __struct.target_system = buf.get_u8();
28387 __struct.target_component = buf.get_u8();
28388 Ok(__struct)
28389 }
28390 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28391 let mut __tmp = BytesMut::new(bytes);
28392 #[allow(clippy::absurd_extreme_comparisons)]
28393 #[allow(unused_comparisons)]
28394 if __tmp.remaining() < Self::ENCODED_LEN {
28395 panic!(
28396 "buffer is too small (need {} bytes, but got {})",
28397 Self::ENCODED_LEN,
28398 __tmp.remaining(),
28399 )
28400 }
28401 __tmp.put_u32_le(self.format as u32);
28402 __tmp.put_u8(self.target_system);
28403 __tmp.put_u8(self.target_component);
28404 if matches!(version, MavlinkVersion::V2) {
28405 let len = __tmp.len();
28406 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28407 } else {
28408 __tmp.len()
28409 }
28410 }
28411}
28412#[doc = "id: 2"]
28413#[doc = "The system time is the time of the master clock. This can be emitted by flight controllers, onboard computers, or other components in the MAVLink network. Components that are using a less reliable time source, such as a battery-backed real time clock, can choose to match their system clock to that of a SYSTEM_TYPE that indicates a more recent time. This allows more broadly accurate date stamping of logs, and so on. If precise time synchronization is needed then use TIMESYNC instead."]
28414#[derive(Debug, Clone, PartialEq)]
28415#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28416#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28417pub struct SYSTEM_TIME_DATA {
28418 #[doc = "Timestamp (UNIX epoch time)."]
28419 pub time_unix_usec: u64,
28420 #[doc = "Timestamp (time since system boot)."]
28421 pub time_boot_ms: u32,
28422}
28423impl SYSTEM_TIME_DATA {
28424 pub const ENCODED_LEN: usize = 12usize;
28425 pub const DEFAULT: Self = Self {
28426 time_unix_usec: 0_u64,
28427 time_boot_ms: 0_u32,
28428 };
28429 #[cfg(feature = "arbitrary")]
28430 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28431 use arbitrary::{Arbitrary, Unstructured};
28432 let mut buf = [0u8; 1024];
28433 rng.fill_bytes(&mut buf);
28434 let mut unstructured = Unstructured::new(&buf);
28435 Self::arbitrary(&mut unstructured).unwrap_or_default()
28436 }
28437}
28438impl Default for SYSTEM_TIME_DATA {
28439 fn default() -> Self {
28440 Self::DEFAULT.clone()
28441 }
28442}
28443impl MessageData for SYSTEM_TIME_DATA {
28444 type Message = MavMessage;
28445 const ID: u32 = 2u32;
28446 const NAME: &'static str = "SYSTEM_TIME";
28447 const EXTRA_CRC: u8 = 137u8;
28448 const ENCODED_LEN: usize = 12usize;
28449 fn deser(
28450 _version: MavlinkVersion,
28451 __input: &[u8],
28452 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28453 let avail_len = __input.len();
28454 let mut payload_buf = [0; Self::ENCODED_LEN];
28455 let mut buf = if avail_len < Self::ENCODED_LEN {
28456 payload_buf[0..avail_len].copy_from_slice(__input);
28457 Bytes::new(&payload_buf)
28458 } else {
28459 Bytes::new(__input)
28460 };
28461 let mut __struct = Self::default();
28462 __struct.time_unix_usec = buf.get_u64_le();
28463 __struct.time_boot_ms = buf.get_u32_le();
28464 Ok(__struct)
28465 }
28466 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28467 let mut __tmp = BytesMut::new(bytes);
28468 #[allow(clippy::absurd_extreme_comparisons)]
28469 #[allow(unused_comparisons)]
28470 if __tmp.remaining() < Self::ENCODED_LEN {
28471 panic!(
28472 "buffer is too small (need {} bytes, but got {})",
28473 Self::ENCODED_LEN,
28474 __tmp.remaining(),
28475 )
28476 }
28477 __tmp.put_u64_le(self.time_unix_usec);
28478 __tmp.put_u32_le(self.time_boot_ms);
28479 if matches!(version, MavlinkVersion::V2) {
28480 let len = __tmp.len();
28481 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28482 } else {
28483 __tmp.len()
28484 }
28485 }
28486}
28487#[doc = "id: 1"]
28488#[doc = "The general system state. If the system is following the MAVLink standard, the system state is mainly defined by three orthogonal states/modes: The system mode, which is either LOCKED (motors shut down and locked), MANUAL (system under RC control), GUIDED (system with autonomous position control, position setpoint controlled manually) or AUTO (system guided by path/waypoint planner). The NAV_MODE defined the current flight state: LIFTOFF (often an open-loop maneuver), LANDING, WAYPOINTS or VECTOR. This represents the internal navigation state machine. The system status shows whether the system is currently active or not and if an emergency occurred. During the CRITICAL and EMERGENCY states the MAV is still considered to be active, but should start emergency procedures autonomously. After a failure occurred it should first move from active to critical to allow manual intervention and then move to emergency after a certain timeout."]
28489#[derive(Debug, Clone, PartialEq)]
28490#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28491#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28492pub struct SYS_STATUS_DATA {
28493 #[doc = "Bitmap showing which onboard controllers and sensors are present. Value of 0: not present. Value of 1: present."]
28494 pub onboard_control_sensors_present: MavSysStatusSensor,
28495 #[doc = "Bitmap showing which onboard controllers and sensors are enabled: Value of 0: not enabled. Value of 1: enabled."]
28496 pub onboard_control_sensors_enabled: MavSysStatusSensor,
28497 #[doc = "Bitmap showing which onboard controllers and sensors have an error (or are operational). Value of 0: error. Value of 1: healthy."]
28498 pub onboard_control_sensors_health: MavSysStatusSensor,
28499 #[doc = "Maximum usage in percent of the mainloop time. Values: [0-1000] - should always be below 1000"]
28500 pub load: u16,
28501 #[doc = "Battery voltage, UINT16_MAX: Voltage not sent by autopilot"]
28502 pub voltage_battery: u16,
28503 #[doc = "Battery current, -1: Current not sent by autopilot"]
28504 pub current_battery: i16,
28505 #[doc = "Communication drop rate, (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV)"]
28506 pub drop_rate_comm: u16,
28507 #[doc = "Communication errors (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV)"]
28508 pub errors_comm: u16,
28509 #[doc = "Autopilot-specific errors"]
28510 pub errors_count1: u16,
28511 #[doc = "Autopilot-specific errors"]
28512 pub errors_count2: u16,
28513 #[doc = "Autopilot-specific errors"]
28514 pub errors_count3: u16,
28515 #[doc = "Autopilot-specific errors"]
28516 pub errors_count4: u16,
28517 #[doc = "Battery energy remaining, -1: Battery remaining energy not sent by autopilot"]
28518 pub battery_remaining: i8,
28519 #[doc = "Bitmap showing which onboard controllers and sensors are present. Value of 0: not present. Value of 1: present."]
28520 #[cfg_attr(feature = "serde", serde(default))]
28521 pub onboard_control_sensors_present_extended: MavSysStatusSensorExtended,
28522 #[doc = "Bitmap showing which onboard controllers and sensors are enabled: Value of 0: not enabled. Value of 1: enabled."]
28523 #[cfg_attr(feature = "serde", serde(default))]
28524 pub onboard_control_sensors_enabled_extended: MavSysStatusSensorExtended,
28525 #[doc = "Bitmap showing which onboard controllers and sensors have an error (or are operational). Value of 0: error. Value of 1: healthy."]
28526 #[cfg_attr(feature = "serde", serde(default))]
28527 pub onboard_control_sensors_health_extended: MavSysStatusSensorExtended,
28528}
28529impl SYS_STATUS_DATA {
28530 pub const ENCODED_LEN: usize = 43usize;
28531 pub const DEFAULT: Self = Self {
28532 onboard_control_sensors_present: MavSysStatusSensor::DEFAULT,
28533 onboard_control_sensors_enabled: MavSysStatusSensor::DEFAULT,
28534 onboard_control_sensors_health: MavSysStatusSensor::DEFAULT,
28535 load: 0_u16,
28536 voltage_battery: 0_u16,
28537 current_battery: 0_i16,
28538 drop_rate_comm: 0_u16,
28539 errors_comm: 0_u16,
28540 errors_count1: 0_u16,
28541 errors_count2: 0_u16,
28542 errors_count3: 0_u16,
28543 errors_count4: 0_u16,
28544 battery_remaining: 0_i8,
28545 onboard_control_sensors_present_extended: MavSysStatusSensorExtended::DEFAULT,
28546 onboard_control_sensors_enabled_extended: MavSysStatusSensorExtended::DEFAULT,
28547 onboard_control_sensors_health_extended: MavSysStatusSensorExtended::DEFAULT,
28548 };
28549 #[cfg(feature = "arbitrary")]
28550 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28551 use arbitrary::{Arbitrary, Unstructured};
28552 let mut buf = [0u8; 1024];
28553 rng.fill_bytes(&mut buf);
28554 let mut unstructured = Unstructured::new(&buf);
28555 Self::arbitrary(&mut unstructured).unwrap_or_default()
28556 }
28557}
28558impl Default for SYS_STATUS_DATA {
28559 fn default() -> Self {
28560 Self::DEFAULT.clone()
28561 }
28562}
28563impl MessageData for SYS_STATUS_DATA {
28564 type Message = MavMessage;
28565 const ID: u32 = 1u32;
28566 const NAME: &'static str = "SYS_STATUS";
28567 const EXTRA_CRC: u8 = 124u8;
28568 const ENCODED_LEN: usize = 43usize;
28569 fn deser(
28570 _version: MavlinkVersion,
28571 __input: &[u8],
28572 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28573 let avail_len = __input.len();
28574 let mut payload_buf = [0; Self::ENCODED_LEN];
28575 let mut buf = if avail_len < Self::ENCODED_LEN {
28576 payload_buf[0..avail_len].copy_from_slice(__input);
28577 Bytes::new(&payload_buf)
28578 } else {
28579 Bytes::new(__input)
28580 };
28581 let mut __struct = Self::default();
28582 let tmp = buf.get_u32_le();
28583 __struct.onboard_control_sensors_present = MavSysStatusSensor::from_bits(
28584 tmp & MavSysStatusSensor::all().bits(),
28585 )
28586 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
28587 flag_type: "MavSysStatusSensor",
28588 value: tmp as u32,
28589 })?;
28590 let tmp = buf.get_u32_le();
28591 __struct.onboard_control_sensors_enabled = MavSysStatusSensor::from_bits(
28592 tmp & MavSysStatusSensor::all().bits(),
28593 )
28594 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
28595 flag_type: "MavSysStatusSensor",
28596 value: tmp as u32,
28597 })?;
28598 let tmp = buf.get_u32_le();
28599 __struct.onboard_control_sensors_health = MavSysStatusSensor::from_bits(
28600 tmp & MavSysStatusSensor::all().bits(),
28601 )
28602 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
28603 flag_type: "MavSysStatusSensor",
28604 value: tmp as u32,
28605 })?;
28606 __struct.load = buf.get_u16_le();
28607 __struct.voltage_battery = buf.get_u16_le();
28608 __struct.current_battery = buf.get_i16_le();
28609 __struct.drop_rate_comm = buf.get_u16_le();
28610 __struct.errors_comm = buf.get_u16_le();
28611 __struct.errors_count1 = buf.get_u16_le();
28612 __struct.errors_count2 = buf.get_u16_le();
28613 __struct.errors_count3 = buf.get_u16_le();
28614 __struct.errors_count4 = buf.get_u16_le();
28615 __struct.battery_remaining = buf.get_i8();
28616 let tmp = buf.get_u32_le();
28617 __struct.onboard_control_sensors_present_extended =
28618 MavSysStatusSensorExtended::from_bits(tmp & MavSysStatusSensorExtended::all().bits())
28619 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
28620 flag_type: "MavSysStatusSensorExtended",
28621 value: tmp as u32,
28622 })?;
28623 let tmp = buf.get_u32_le();
28624 __struct.onboard_control_sensors_enabled_extended =
28625 MavSysStatusSensorExtended::from_bits(tmp & MavSysStatusSensorExtended::all().bits())
28626 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
28627 flag_type: "MavSysStatusSensorExtended",
28628 value: tmp as u32,
28629 })?;
28630 let tmp = buf.get_u32_le();
28631 __struct.onboard_control_sensors_health_extended =
28632 MavSysStatusSensorExtended::from_bits(tmp & MavSysStatusSensorExtended::all().bits())
28633 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
28634 flag_type: "MavSysStatusSensorExtended",
28635 value: tmp as u32,
28636 })?;
28637 Ok(__struct)
28638 }
28639 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28640 let mut __tmp = BytesMut::new(bytes);
28641 #[allow(clippy::absurd_extreme_comparisons)]
28642 #[allow(unused_comparisons)]
28643 if __tmp.remaining() < Self::ENCODED_LEN {
28644 panic!(
28645 "buffer is too small (need {} bytes, but got {})",
28646 Self::ENCODED_LEN,
28647 __tmp.remaining(),
28648 )
28649 }
28650 __tmp.put_u32_le(self.onboard_control_sensors_present.bits());
28651 __tmp.put_u32_le(self.onboard_control_sensors_enabled.bits());
28652 __tmp.put_u32_le(self.onboard_control_sensors_health.bits());
28653 __tmp.put_u16_le(self.load);
28654 __tmp.put_u16_le(self.voltage_battery);
28655 __tmp.put_i16_le(self.current_battery);
28656 __tmp.put_u16_le(self.drop_rate_comm);
28657 __tmp.put_u16_le(self.errors_comm);
28658 __tmp.put_u16_le(self.errors_count1);
28659 __tmp.put_u16_le(self.errors_count2);
28660 __tmp.put_u16_le(self.errors_count3);
28661 __tmp.put_u16_le(self.errors_count4);
28662 __tmp.put_i8(self.battery_remaining);
28663 __tmp.put_u32_le(self.onboard_control_sensors_present_extended.bits());
28664 __tmp.put_u32_le(self.onboard_control_sensors_enabled_extended.bits());
28665 __tmp.put_u32_le(self.onboard_control_sensors_health_extended.bits());
28666 if matches!(version, MavlinkVersion::V2) {
28667 let len = __tmp.len();
28668 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28669 } else {
28670 __tmp.len()
28671 }
28672 }
28673}
28674#[doc = "id: 135"]
28675#[doc = "Request that the vehicle report terrain height at the given location (expected response is a TERRAIN_REPORT). Used by GCS to check if vehicle has all terrain data needed for a mission."]
28676#[derive(Debug, Clone, PartialEq)]
28677#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28678#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28679pub struct TERRAIN_CHECK_DATA {
28680 #[doc = "Latitude"]
28681 pub lat: i32,
28682 #[doc = "Longitude"]
28683 pub lon: i32,
28684}
28685impl TERRAIN_CHECK_DATA {
28686 pub const ENCODED_LEN: usize = 8usize;
28687 pub const DEFAULT: Self = Self {
28688 lat: 0_i32,
28689 lon: 0_i32,
28690 };
28691 #[cfg(feature = "arbitrary")]
28692 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28693 use arbitrary::{Arbitrary, Unstructured};
28694 let mut buf = [0u8; 1024];
28695 rng.fill_bytes(&mut buf);
28696 let mut unstructured = Unstructured::new(&buf);
28697 Self::arbitrary(&mut unstructured).unwrap_or_default()
28698 }
28699}
28700impl Default for TERRAIN_CHECK_DATA {
28701 fn default() -> Self {
28702 Self::DEFAULT.clone()
28703 }
28704}
28705impl MessageData for TERRAIN_CHECK_DATA {
28706 type Message = MavMessage;
28707 const ID: u32 = 135u32;
28708 const NAME: &'static str = "TERRAIN_CHECK";
28709 const EXTRA_CRC: u8 = 203u8;
28710 const ENCODED_LEN: usize = 8usize;
28711 fn deser(
28712 _version: MavlinkVersion,
28713 __input: &[u8],
28714 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28715 let avail_len = __input.len();
28716 let mut payload_buf = [0; Self::ENCODED_LEN];
28717 let mut buf = if avail_len < Self::ENCODED_LEN {
28718 payload_buf[0..avail_len].copy_from_slice(__input);
28719 Bytes::new(&payload_buf)
28720 } else {
28721 Bytes::new(__input)
28722 };
28723 let mut __struct = Self::default();
28724 __struct.lat = buf.get_i32_le();
28725 __struct.lon = buf.get_i32_le();
28726 Ok(__struct)
28727 }
28728 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28729 let mut __tmp = BytesMut::new(bytes);
28730 #[allow(clippy::absurd_extreme_comparisons)]
28731 #[allow(unused_comparisons)]
28732 if __tmp.remaining() < Self::ENCODED_LEN {
28733 panic!(
28734 "buffer is too small (need {} bytes, but got {})",
28735 Self::ENCODED_LEN,
28736 __tmp.remaining(),
28737 )
28738 }
28739 __tmp.put_i32_le(self.lat);
28740 __tmp.put_i32_le(self.lon);
28741 if matches!(version, MavlinkVersion::V2) {
28742 let len = __tmp.len();
28743 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28744 } else {
28745 __tmp.len()
28746 }
28747 }
28748}
28749#[doc = "id: 134"]
28750#[doc = "Terrain data sent from GCS. The lat/lon and grid_spacing must be the same as a lat/lon from a TERRAIN_REQUEST. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
28751#[derive(Debug, Clone, PartialEq)]
28752#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28753#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28754pub struct TERRAIN_DATA_DATA {
28755 #[doc = "Latitude of SW corner of first grid"]
28756 pub lat: i32,
28757 #[doc = "Longitude of SW corner of first grid"]
28758 pub lon: i32,
28759 #[doc = "Grid spacing"]
28760 pub grid_spacing: u16,
28761 #[doc = "Terrain data MSL"]
28762 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28763 pub data: [i16; 16],
28764 #[doc = "bit within the terrain request mask"]
28765 pub gridbit: u8,
28766}
28767impl TERRAIN_DATA_DATA {
28768 pub const ENCODED_LEN: usize = 43usize;
28769 pub const DEFAULT: Self = Self {
28770 lat: 0_i32,
28771 lon: 0_i32,
28772 grid_spacing: 0_u16,
28773 data: [0_i16; 16usize],
28774 gridbit: 0_u8,
28775 };
28776 #[cfg(feature = "arbitrary")]
28777 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28778 use arbitrary::{Arbitrary, Unstructured};
28779 let mut buf = [0u8; 1024];
28780 rng.fill_bytes(&mut buf);
28781 let mut unstructured = Unstructured::new(&buf);
28782 Self::arbitrary(&mut unstructured).unwrap_or_default()
28783 }
28784}
28785impl Default for TERRAIN_DATA_DATA {
28786 fn default() -> Self {
28787 Self::DEFAULT.clone()
28788 }
28789}
28790impl MessageData for TERRAIN_DATA_DATA {
28791 type Message = MavMessage;
28792 const ID: u32 = 134u32;
28793 const NAME: &'static str = "TERRAIN_DATA";
28794 const EXTRA_CRC: u8 = 229u8;
28795 const ENCODED_LEN: usize = 43usize;
28796 fn deser(
28797 _version: MavlinkVersion,
28798 __input: &[u8],
28799 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28800 let avail_len = __input.len();
28801 let mut payload_buf = [0; Self::ENCODED_LEN];
28802 let mut buf = if avail_len < Self::ENCODED_LEN {
28803 payload_buf[0..avail_len].copy_from_slice(__input);
28804 Bytes::new(&payload_buf)
28805 } else {
28806 Bytes::new(__input)
28807 };
28808 let mut __struct = Self::default();
28809 __struct.lat = buf.get_i32_le();
28810 __struct.lon = buf.get_i32_le();
28811 __struct.grid_spacing = buf.get_u16_le();
28812 for v in &mut __struct.data {
28813 let val = buf.get_i16_le();
28814 *v = val;
28815 }
28816 __struct.gridbit = buf.get_u8();
28817 Ok(__struct)
28818 }
28819 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28820 let mut __tmp = BytesMut::new(bytes);
28821 #[allow(clippy::absurd_extreme_comparisons)]
28822 #[allow(unused_comparisons)]
28823 if __tmp.remaining() < Self::ENCODED_LEN {
28824 panic!(
28825 "buffer is too small (need {} bytes, but got {})",
28826 Self::ENCODED_LEN,
28827 __tmp.remaining(),
28828 )
28829 }
28830 __tmp.put_i32_le(self.lat);
28831 __tmp.put_i32_le(self.lon);
28832 __tmp.put_u16_le(self.grid_spacing);
28833 for val in &self.data {
28834 __tmp.put_i16_le(*val);
28835 }
28836 __tmp.put_u8(self.gridbit);
28837 if matches!(version, MavlinkVersion::V2) {
28838 let len = __tmp.len();
28839 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28840 } else {
28841 __tmp.len()
28842 }
28843 }
28844}
28845#[doc = "id: 136"]
28846#[doc = "Streamed from drone to report progress of terrain map download (initiated by TERRAIN_REQUEST), or sent as a response to a TERRAIN_CHECK request. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
28847#[derive(Debug, Clone, PartialEq)]
28848#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28849#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28850pub struct TERRAIN_REPORT_DATA {
28851 #[doc = "Latitude"]
28852 pub lat: i32,
28853 #[doc = "Longitude"]
28854 pub lon: i32,
28855 #[doc = "Terrain height MSL"]
28856 pub terrain_height: f32,
28857 #[doc = "Current vehicle height above lat/lon terrain height"]
28858 pub current_height: f32,
28859 #[doc = "grid spacing (zero if terrain at this location unavailable)"]
28860 pub spacing: u16,
28861 #[doc = "Number of 4x4 terrain blocks waiting to be received or read from disk"]
28862 pub pending: u16,
28863 #[doc = "Number of 4x4 terrain blocks in memory"]
28864 pub loaded: u16,
28865}
28866impl TERRAIN_REPORT_DATA {
28867 pub const ENCODED_LEN: usize = 22usize;
28868 pub const DEFAULT: Self = Self {
28869 lat: 0_i32,
28870 lon: 0_i32,
28871 terrain_height: 0.0_f32,
28872 current_height: 0.0_f32,
28873 spacing: 0_u16,
28874 pending: 0_u16,
28875 loaded: 0_u16,
28876 };
28877 #[cfg(feature = "arbitrary")]
28878 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28879 use arbitrary::{Arbitrary, Unstructured};
28880 let mut buf = [0u8; 1024];
28881 rng.fill_bytes(&mut buf);
28882 let mut unstructured = Unstructured::new(&buf);
28883 Self::arbitrary(&mut unstructured).unwrap_or_default()
28884 }
28885}
28886impl Default for TERRAIN_REPORT_DATA {
28887 fn default() -> Self {
28888 Self::DEFAULT.clone()
28889 }
28890}
28891impl MessageData for TERRAIN_REPORT_DATA {
28892 type Message = MavMessage;
28893 const ID: u32 = 136u32;
28894 const NAME: &'static str = "TERRAIN_REPORT";
28895 const EXTRA_CRC: u8 = 1u8;
28896 const ENCODED_LEN: usize = 22usize;
28897 fn deser(
28898 _version: MavlinkVersion,
28899 __input: &[u8],
28900 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28901 let avail_len = __input.len();
28902 let mut payload_buf = [0; Self::ENCODED_LEN];
28903 let mut buf = if avail_len < Self::ENCODED_LEN {
28904 payload_buf[0..avail_len].copy_from_slice(__input);
28905 Bytes::new(&payload_buf)
28906 } else {
28907 Bytes::new(__input)
28908 };
28909 let mut __struct = Self::default();
28910 __struct.lat = buf.get_i32_le();
28911 __struct.lon = buf.get_i32_le();
28912 __struct.terrain_height = buf.get_f32_le();
28913 __struct.current_height = buf.get_f32_le();
28914 __struct.spacing = buf.get_u16_le();
28915 __struct.pending = buf.get_u16_le();
28916 __struct.loaded = buf.get_u16_le();
28917 Ok(__struct)
28918 }
28919 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28920 let mut __tmp = BytesMut::new(bytes);
28921 #[allow(clippy::absurd_extreme_comparisons)]
28922 #[allow(unused_comparisons)]
28923 if __tmp.remaining() < Self::ENCODED_LEN {
28924 panic!(
28925 "buffer is too small (need {} bytes, but got {})",
28926 Self::ENCODED_LEN,
28927 __tmp.remaining(),
28928 )
28929 }
28930 __tmp.put_i32_le(self.lat);
28931 __tmp.put_i32_le(self.lon);
28932 __tmp.put_f32_le(self.terrain_height);
28933 __tmp.put_f32_le(self.current_height);
28934 __tmp.put_u16_le(self.spacing);
28935 __tmp.put_u16_le(self.pending);
28936 __tmp.put_u16_le(self.loaded);
28937 if matches!(version, MavlinkVersion::V2) {
28938 let len = __tmp.len();
28939 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28940 } else {
28941 __tmp.len()
28942 }
28943 }
28944}
28945#[doc = "id: 133"]
28946#[doc = "Request for terrain data and terrain status. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
28947#[derive(Debug, Clone, PartialEq)]
28948#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28949#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28950pub struct TERRAIN_REQUEST_DATA {
28951 #[doc = "Bitmask of requested 4x4 grids (row major 8x7 array of grids, 56 bits)"]
28952 pub mask: u64,
28953 #[doc = "Latitude of SW corner of first grid"]
28954 pub lat: i32,
28955 #[doc = "Longitude of SW corner of first grid"]
28956 pub lon: i32,
28957 #[doc = "Grid spacing"]
28958 pub grid_spacing: u16,
28959}
28960impl TERRAIN_REQUEST_DATA {
28961 pub const ENCODED_LEN: usize = 18usize;
28962 pub const DEFAULT: Self = Self {
28963 mask: 0_u64,
28964 lat: 0_i32,
28965 lon: 0_i32,
28966 grid_spacing: 0_u16,
28967 };
28968 #[cfg(feature = "arbitrary")]
28969 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28970 use arbitrary::{Arbitrary, Unstructured};
28971 let mut buf = [0u8; 1024];
28972 rng.fill_bytes(&mut buf);
28973 let mut unstructured = Unstructured::new(&buf);
28974 Self::arbitrary(&mut unstructured).unwrap_or_default()
28975 }
28976}
28977impl Default for TERRAIN_REQUEST_DATA {
28978 fn default() -> Self {
28979 Self::DEFAULT.clone()
28980 }
28981}
28982impl MessageData for TERRAIN_REQUEST_DATA {
28983 type Message = MavMessage;
28984 const ID: u32 = 133u32;
28985 const NAME: &'static str = "TERRAIN_REQUEST";
28986 const EXTRA_CRC: u8 = 6u8;
28987 const ENCODED_LEN: usize = 18usize;
28988 fn deser(
28989 _version: MavlinkVersion,
28990 __input: &[u8],
28991 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28992 let avail_len = __input.len();
28993 let mut payload_buf = [0; Self::ENCODED_LEN];
28994 let mut buf = if avail_len < Self::ENCODED_LEN {
28995 payload_buf[0..avail_len].copy_from_slice(__input);
28996 Bytes::new(&payload_buf)
28997 } else {
28998 Bytes::new(__input)
28999 };
29000 let mut __struct = Self::default();
29001 __struct.mask = buf.get_u64_le();
29002 __struct.lat = buf.get_i32_le();
29003 __struct.lon = buf.get_i32_le();
29004 __struct.grid_spacing = buf.get_u16_le();
29005 Ok(__struct)
29006 }
29007 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29008 let mut __tmp = BytesMut::new(bytes);
29009 #[allow(clippy::absurd_extreme_comparisons)]
29010 #[allow(unused_comparisons)]
29011 if __tmp.remaining() < Self::ENCODED_LEN {
29012 panic!(
29013 "buffer is too small (need {} bytes, but got {})",
29014 Self::ENCODED_LEN,
29015 __tmp.remaining(),
29016 )
29017 }
29018 __tmp.put_u64_le(self.mask);
29019 __tmp.put_i32_le(self.lat);
29020 __tmp.put_i32_le(self.lon);
29021 __tmp.put_u16_le(self.grid_spacing);
29022 if matches!(version, MavlinkVersion::V2) {
29023 let len = __tmp.len();
29024 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29025 } else {
29026 __tmp.len()
29027 }
29028 }
29029}
29030#[doc = "id: 111"]
29031#[doc = "Time synchronization message. The message is used for both timesync requests and responses. The request is sent with `ts1=syncing component timestamp` and `tc1=0`, and may be broadcast or targeted to a specific system/component. The response is sent with `ts1=syncing component timestamp` (mirror back unchanged), and `tc1=responding component timestamp`, with the `target_system` and `target_component` set to ids of the original request. Systems can determine if they are receiving a request or response based on the value of `tc`. If the response has `target_system==target_component==0` the remote system has not been updated to use the component IDs and cannot reliably timesync; the requestor may report an error. Timestamps are UNIX Epoch time or time since system boot in nanoseconds (the timestamp format can be inferred by checking for the magnitude of the number; generally it doesn't matter as only the offset is used). The message sequence is repeated numerous times with results being filtered/averaged to estimate the offset. See also: <https://mavlink.io/en/services/timesync.html>."]
29032#[derive(Debug, Clone, PartialEq)]
29033#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29034#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29035pub struct TIMESYNC_DATA {
29036 #[doc = "Time sync timestamp 1. Syncing: 0. Responding: Timestamp of responding component."]
29037 pub tc1: i64,
29038 #[doc = "Time sync timestamp 2. Timestamp of syncing component (mirrored in response)."]
29039 pub ts1: i64,
29040 #[doc = "Target system id. Request: 0 (broadcast) or id of specific system. Response must contain system id of the requesting component."]
29041 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29042 pub target_system: u8,
29043 #[doc = "Target component id. Request: 0 (broadcast) or id of specific component. Response must contain component id of the requesting component."]
29044 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29045 pub target_component: u8,
29046}
29047impl TIMESYNC_DATA {
29048 pub const ENCODED_LEN: usize = 18usize;
29049 pub const DEFAULT: Self = Self {
29050 tc1: 0_i64,
29051 ts1: 0_i64,
29052 target_system: 0_u8,
29053 target_component: 0_u8,
29054 };
29055 #[cfg(feature = "arbitrary")]
29056 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29057 use arbitrary::{Arbitrary, Unstructured};
29058 let mut buf = [0u8; 1024];
29059 rng.fill_bytes(&mut buf);
29060 let mut unstructured = Unstructured::new(&buf);
29061 Self::arbitrary(&mut unstructured).unwrap_or_default()
29062 }
29063}
29064impl Default for TIMESYNC_DATA {
29065 fn default() -> Self {
29066 Self::DEFAULT.clone()
29067 }
29068}
29069impl MessageData for TIMESYNC_DATA {
29070 type Message = MavMessage;
29071 const ID: u32 = 111u32;
29072 const NAME: &'static str = "TIMESYNC";
29073 const EXTRA_CRC: u8 = 34u8;
29074 const ENCODED_LEN: usize = 18usize;
29075 fn deser(
29076 _version: MavlinkVersion,
29077 __input: &[u8],
29078 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29079 let avail_len = __input.len();
29080 let mut payload_buf = [0; Self::ENCODED_LEN];
29081 let mut buf = if avail_len < Self::ENCODED_LEN {
29082 payload_buf[0..avail_len].copy_from_slice(__input);
29083 Bytes::new(&payload_buf)
29084 } else {
29085 Bytes::new(__input)
29086 };
29087 let mut __struct = Self::default();
29088 __struct.tc1 = buf.get_i64_le();
29089 __struct.ts1 = buf.get_i64_le();
29090 __struct.target_system = buf.get_u8();
29091 __struct.target_component = buf.get_u8();
29092 Ok(__struct)
29093 }
29094 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29095 let mut __tmp = BytesMut::new(bytes);
29096 #[allow(clippy::absurd_extreme_comparisons)]
29097 #[allow(unused_comparisons)]
29098 if __tmp.remaining() < Self::ENCODED_LEN {
29099 panic!(
29100 "buffer is too small (need {} bytes, but got {})",
29101 Self::ENCODED_LEN,
29102 __tmp.remaining(),
29103 )
29104 }
29105 __tmp.put_i64_le(self.tc1);
29106 __tmp.put_i64_le(self.ts1);
29107 __tmp.put_u8(self.target_system);
29108 __tmp.put_u8(self.target_component);
29109 if matches!(version, MavlinkVersion::V2) {
29110 let len = __tmp.len();
29111 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29112 } else {
29113 __tmp.len()
29114 }
29115 }
29116}
29117#[doc = "id: 380"]
29118#[doc = "Time/duration estimates for various events and actions given the current vehicle state and position."]
29119#[derive(Debug, Clone, PartialEq)]
29120#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29121#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29122pub struct TIME_ESTIMATE_TO_TARGET_DATA {
29123 #[doc = "Estimated time to complete the vehicle's configured \"safe return\" action from its current position (e.g. RTL, Smart RTL, etc.). -1 indicates that the vehicle is landed, or that no time estimate available."]
29124 pub safe_return: i32,
29125 #[doc = "Estimated time for vehicle to complete the LAND action from its current position. -1 indicates that the vehicle is landed, or that no time estimate available."]
29126 pub land: i32,
29127 #[doc = "Estimated time for reaching/completing the currently active mission item. -1 means no time estimate available."]
29128 pub mission_next_item: i32,
29129 #[doc = "Estimated time for completing the current mission. -1 means no mission active and/or no estimate available."]
29130 pub mission_end: i32,
29131 #[doc = "Estimated time for completing the current commanded action (i.e. Go To, Takeoff, Land, etc.). -1 means no action active and/or no estimate available."]
29132 pub commanded_action: i32,
29133}
29134impl TIME_ESTIMATE_TO_TARGET_DATA {
29135 pub const ENCODED_LEN: usize = 20usize;
29136 pub const DEFAULT: Self = Self {
29137 safe_return: 0_i32,
29138 land: 0_i32,
29139 mission_next_item: 0_i32,
29140 mission_end: 0_i32,
29141 commanded_action: 0_i32,
29142 };
29143 #[cfg(feature = "arbitrary")]
29144 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29145 use arbitrary::{Arbitrary, Unstructured};
29146 let mut buf = [0u8; 1024];
29147 rng.fill_bytes(&mut buf);
29148 let mut unstructured = Unstructured::new(&buf);
29149 Self::arbitrary(&mut unstructured).unwrap_or_default()
29150 }
29151}
29152impl Default for TIME_ESTIMATE_TO_TARGET_DATA {
29153 fn default() -> Self {
29154 Self::DEFAULT.clone()
29155 }
29156}
29157impl MessageData for TIME_ESTIMATE_TO_TARGET_DATA {
29158 type Message = MavMessage;
29159 const ID: u32 = 380u32;
29160 const NAME: &'static str = "TIME_ESTIMATE_TO_TARGET";
29161 const EXTRA_CRC: u8 = 232u8;
29162 const ENCODED_LEN: usize = 20usize;
29163 fn deser(
29164 _version: MavlinkVersion,
29165 __input: &[u8],
29166 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29167 let avail_len = __input.len();
29168 let mut payload_buf = [0; Self::ENCODED_LEN];
29169 let mut buf = if avail_len < Self::ENCODED_LEN {
29170 payload_buf[0..avail_len].copy_from_slice(__input);
29171 Bytes::new(&payload_buf)
29172 } else {
29173 Bytes::new(__input)
29174 };
29175 let mut __struct = Self::default();
29176 __struct.safe_return = buf.get_i32_le();
29177 __struct.land = buf.get_i32_le();
29178 __struct.mission_next_item = buf.get_i32_le();
29179 __struct.mission_end = buf.get_i32_le();
29180 __struct.commanded_action = buf.get_i32_le();
29181 Ok(__struct)
29182 }
29183 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29184 let mut __tmp = BytesMut::new(bytes);
29185 #[allow(clippy::absurd_extreme_comparisons)]
29186 #[allow(unused_comparisons)]
29187 if __tmp.remaining() < Self::ENCODED_LEN {
29188 panic!(
29189 "buffer is too small (need {} bytes, but got {})",
29190 Self::ENCODED_LEN,
29191 __tmp.remaining(),
29192 )
29193 }
29194 __tmp.put_i32_le(self.safe_return);
29195 __tmp.put_i32_le(self.land);
29196 __tmp.put_i32_le(self.mission_next_item);
29197 __tmp.put_i32_le(self.mission_end);
29198 __tmp.put_i32_le(self.commanded_action);
29199 if matches!(version, MavlinkVersion::V2) {
29200 let len = __tmp.len();
29201 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29202 } else {
29203 __tmp.len()
29204 }
29205 }
29206}
29207#[doc = "id: 333"]
29208#[doc = "Describe a trajectory using an array of up-to 5 bezier control points in the local frame (MAV_FRAME_LOCAL_NED)."]
29209#[derive(Debug, Clone, PartialEq)]
29210#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29211#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29212pub struct TRAJECTORY_REPRESENTATION_BEZIER_DATA {
29213 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
29214 pub time_usec: u64,
29215 #[doc = "X-coordinate of bezier control points. Set to NaN if not being used"]
29216 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29217 pub pos_x: [f32; 5],
29218 #[doc = "Y-coordinate of bezier control points. Set to NaN if not being used"]
29219 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29220 pub pos_y: [f32; 5],
29221 #[doc = "Z-coordinate of bezier control points. Set to NaN if not being used"]
29222 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29223 pub pos_z: [f32; 5],
29224 #[doc = "Bezier time horizon. Set to NaN if velocity/acceleration should not be incorporated"]
29225 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29226 pub delta: [f32; 5],
29227 #[doc = "Yaw. Set to NaN for unchanged"]
29228 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29229 pub pos_yaw: [f32; 5],
29230 #[doc = "Number of valid control points (up-to 5 points are possible)"]
29231 pub valid_points: u8,
29232}
29233impl TRAJECTORY_REPRESENTATION_BEZIER_DATA {
29234 pub const ENCODED_LEN: usize = 109usize;
29235 pub const DEFAULT: Self = Self {
29236 time_usec: 0_u64,
29237 pos_x: [0.0_f32; 5usize],
29238 pos_y: [0.0_f32; 5usize],
29239 pos_z: [0.0_f32; 5usize],
29240 delta: [0.0_f32; 5usize],
29241 pos_yaw: [0.0_f32; 5usize],
29242 valid_points: 0_u8,
29243 };
29244 #[cfg(feature = "arbitrary")]
29245 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29246 use arbitrary::{Arbitrary, Unstructured};
29247 let mut buf = [0u8; 1024];
29248 rng.fill_bytes(&mut buf);
29249 let mut unstructured = Unstructured::new(&buf);
29250 Self::arbitrary(&mut unstructured).unwrap_or_default()
29251 }
29252}
29253impl Default for TRAJECTORY_REPRESENTATION_BEZIER_DATA {
29254 fn default() -> Self {
29255 Self::DEFAULT.clone()
29256 }
29257}
29258impl MessageData for TRAJECTORY_REPRESENTATION_BEZIER_DATA {
29259 type Message = MavMessage;
29260 const ID: u32 = 333u32;
29261 const NAME: &'static str = "TRAJECTORY_REPRESENTATION_BEZIER";
29262 const EXTRA_CRC: u8 = 231u8;
29263 const ENCODED_LEN: usize = 109usize;
29264 fn deser(
29265 _version: MavlinkVersion,
29266 __input: &[u8],
29267 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29268 let avail_len = __input.len();
29269 let mut payload_buf = [0; Self::ENCODED_LEN];
29270 let mut buf = if avail_len < Self::ENCODED_LEN {
29271 payload_buf[0..avail_len].copy_from_slice(__input);
29272 Bytes::new(&payload_buf)
29273 } else {
29274 Bytes::new(__input)
29275 };
29276 let mut __struct = Self::default();
29277 __struct.time_usec = buf.get_u64_le();
29278 for v in &mut __struct.pos_x {
29279 let val = buf.get_f32_le();
29280 *v = val;
29281 }
29282 for v in &mut __struct.pos_y {
29283 let val = buf.get_f32_le();
29284 *v = val;
29285 }
29286 for v in &mut __struct.pos_z {
29287 let val = buf.get_f32_le();
29288 *v = val;
29289 }
29290 for v in &mut __struct.delta {
29291 let val = buf.get_f32_le();
29292 *v = val;
29293 }
29294 for v in &mut __struct.pos_yaw {
29295 let val = buf.get_f32_le();
29296 *v = val;
29297 }
29298 __struct.valid_points = buf.get_u8();
29299 Ok(__struct)
29300 }
29301 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29302 let mut __tmp = BytesMut::new(bytes);
29303 #[allow(clippy::absurd_extreme_comparisons)]
29304 #[allow(unused_comparisons)]
29305 if __tmp.remaining() < Self::ENCODED_LEN {
29306 panic!(
29307 "buffer is too small (need {} bytes, but got {})",
29308 Self::ENCODED_LEN,
29309 __tmp.remaining(),
29310 )
29311 }
29312 __tmp.put_u64_le(self.time_usec);
29313 for val in &self.pos_x {
29314 __tmp.put_f32_le(*val);
29315 }
29316 for val in &self.pos_y {
29317 __tmp.put_f32_le(*val);
29318 }
29319 for val in &self.pos_z {
29320 __tmp.put_f32_le(*val);
29321 }
29322 for val in &self.delta {
29323 __tmp.put_f32_le(*val);
29324 }
29325 for val in &self.pos_yaw {
29326 __tmp.put_f32_le(*val);
29327 }
29328 __tmp.put_u8(self.valid_points);
29329 if matches!(version, MavlinkVersion::V2) {
29330 let len = __tmp.len();
29331 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29332 } else {
29333 __tmp.len()
29334 }
29335 }
29336}
29337#[doc = "id: 332"]
29338#[doc = "Describe a trajectory using an array of up-to 5 waypoints in the local frame (MAV_FRAME_LOCAL_NED)."]
29339#[derive(Debug, Clone, PartialEq)]
29340#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29341#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29342pub struct TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
29343 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
29344 pub time_usec: u64,
29345 #[doc = "X-coordinate of waypoint, set to NaN if not being used"]
29346 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29347 pub pos_x: [f32; 5],
29348 #[doc = "Y-coordinate of waypoint, set to NaN if not being used"]
29349 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29350 pub pos_y: [f32; 5],
29351 #[doc = "Z-coordinate of waypoint, set to NaN if not being used"]
29352 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29353 pub pos_z: [f32; 5],
29354 #[doc = "X-velocity of waypoint, set to NaN if not being used"]
29355 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29356 pub vel_x: [f32; 5],
29357 #[doc = "Y-velocity of waypoint, set to NaN if not being used"]
29358 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29359 pub vel_y: [f32; 5],
29360 #[doc = "Z-velocity of waypoint, set to NaN if not being used"]
29361 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29362 pub vel_z: [f32; 5],
29363 #[doc = "X-acceleration of waypoint, set to NaN if not being used"]
29364 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29365 pub acc_x: [f32; 5],
29366 #[doc = "Y-acceleration of waypoint, set to NaN if not being used"]
29367 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29368 pub acc_y: [f32; 5],
29369 #[doc = "Z-acceleration of waypoint, set to NaN if not being used"]
29370 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29371 pub acc_z: [f32; 5],
29372 #[doc = "Yaw angle, set to NaN if not being used"]
29373 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29374 pub pos_yaw: [f32; 5],
29375 #[doc = "Yaw rate, set to NaN if not being used"]
29376 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29377 pub vel_yaw: [f32; 5],
29378 #[doc = "MAV_CMD command id of waypoint, set to UINT16_MAX if not being used."]
29379 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29380 pub command: [u16; 5],
29381 #[doc = "Number of valid points (up-to 5 waypoints are possible)"]
29382 pub valid_points: u8,
29383}
29384impl TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
29385 pub const ENCODED_LEN: usize = 239usize;
29386 pub const DEFAULT: Self = Self {
29387 time_usec: 0_u64,
29388 pos_x: [0.0_f32; 5usize],
29389 pos_y: [0.0_f32; 5usize],
29390 pos_z: [0.0_f32; 5usize],
29391 vel_x: [0.0_f32; 5usize],
29392 vel_y: [0.0_f32; 5usize],
29393 vel_z: [0.0_f32; 5usize],
29394 acc_x: [0.0_f32; 5usize],
29395 acc_y: [0.0_f32; 5usize],
29396 acc_z: [0.0_f32; 5usize],
29397 pos_yaw: [0.0_f32; 5usize],
29398 vel_yaw: [0.0_f32; 5usize],
29399 command: [0_u16; 5usize],
29400 valid_points: 0_u8,
29401 };
29402 #[cfg(feature = "arbitrary")]
29403 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29404 use arbitrary::{Arbitrary, Unstructured};
29405 let mut buf = [0u8; 1024];
29406 rng.fill_bytes(&mut buf);
29407 let mut unstructured = Unstructured::new(&buf);
29408 Self::arbitrary(&mut unstructured).unwrap_or_default()
29409 }
29410}
29411impl Default for TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
29412 fn default() -> Self {
29413 Self::DEFAULT.clone()
29414 }
29415}
29416impl MessageData for TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
29417 type Message = MavMessage;
29418 const ID: u32 = 332u32;
29419 const NAME: &'static str = "TRAJECTORY_REPRESENTATION_WAYPOINTS";
29420 const EXTRA_CRC: u8 = 236u8;
29421 const ENCODED_LEN: usize = 239usize;
29422 fn deser(
29423 _version: MavlinkVersion,
29424 __input: &[u8],
29425 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29426 let avail_len = __input.len();
29427 let mut payload_buf = [0; Self::ENCODED_LEN];
29428 let mut buf = if avail_len < Self::ENCODED_LEN {
29429 payload_buf[0..avail_len].copy_from_slice(__input);
29430 Bytes::new(&payload_buf)
29431 } else {
29432 Bytes::new(__input)
29433 };
29434 let mut __struct = Self::default();
29435 __struct.time_usec = buf.get_u64_le();
29436 for v in &mut __struct.pos_x {
29437 let val = buf.get_f32_le();
29438 *v = val;
29439 }
29440 for v in &mut __struct.pos_y {
29441 let val = buf.get_f32_le();
29442 *v = val;
29443 }
29444 for v in &mut __struct.pos_z {
29445 let val = buf.get_f32_le();
29446 *v = val;
29447 }
29448 for v in &mut __struct.vel_x {
29449 let val = buf.get_f32_le();
29450 *v = val;
29451 }
29452 for v in &mut __struct.vel_y {
29453 let val = buf.get_f32_le();
29454 *v = val;
29455 }
29456 for v in &mut __struct.vel_z {
29457 let val = buf.get_f32_le();
29458 *v = val;
29459 }
29460 for v in &mut __struct.acc_x {
29461 let val = buf.get_f32_le();
29462 *v = val;
29463 }
29464 for v in &mut __struct.acc_y {
29465 let val = buf.get_f32_le();
29466 *v = val;
29467 }
29468 for v in &mut __struct.acc_z {
29469 let val = buf.get_f32_le();
29470 *v = val;
29471 }
29472 for v in &mut __struct.pos_yaw {
29473 let val = buf.get_f32_le();
29474 *v = val;
29475 }
29476 for v in &mut __struct.vel_yaw {
29477 let val = buf.get_f32_le();
29478 *v = val;
29479 }
29480 for v in &mut __struct.command {
29481 let val = buf.get_u16_le();
29482 *v = val;
29483 }
29484 __struct.valid_points = buf.get_u8();
29485 Ok(__struct)
29486 }
29487 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29488 let mut __tmp = BytesMut::new(bytes);
29489 #[allow(clippy::absurd_extreme_comparisons)]
29490 #[allow(unused_comparisons)]
29491 if __tmp.remaining() < Self::ENCODED_LEN {
29492 panic!(
29493 "buffer is too small (need {} bytes, but got {})",
29494 Self::ENCODED_LEN,
29495 __tmp.remaining(),
29496 )
29497 }
29498 __tmp.put_u64_le(self.time_usec);
29499 for val in &self.pos_x {
29500 __tmp.put_f32_le(*val);
29501 }
29502 for val in &self.pos_y {
29503 __tmp.put_f32_le(*val);
29504 }
29505 for val in &self.pos_z {
29506 __tmp.put_f32_le(*val);
29507 }
29508 for val in &self.vel_x {
29509 __tmp.put_f32_le(*val);
29510 }
29511 for val in &self.vel_y {
29512 __tmp.put_f32_le(*val);
29513 }
29514 for val in &self.vel_z {
29515 __tmp.put_f32_le(*val);
29516 }
29517 for val in &self.acc_x {
29518 __tmp.put_f32_le(*val);
29519 }
29520 for val in &self.acc_y {
29521 __tmp.put_f32_le(*val);
29522 }
29523 for val in &self.acc_z {
29524 __tmp.put_f32_le(*val);
29525 }
29526 for val in &self.pos_yaw {
29527 __tmp.put_f32_le(*val);
29528 }
29529 for val in &self.vel_yaw {
29530 __tmp.put_f32_le(*val);
29531 }
29532 for val in &self.command {
29533 __tmp.put_u16_le(*val);
29534 }
29535 __tmp.put_u8(self.valid_points);
29536 if matches!(version, MavlinkVersion::V2) {
29537 let len = __tmp.len();
29538 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29539 } else {
29540 __tmp.len()
29541 }
29542 }
29543}
29544#[doc = "id: 385"]
29545#[doc = "Message for transporting \"arbitrary\" variable-length data from one component to another (broadcast is not forbidden, but discouraged). The encoding of the data is usually extension specific, i.e. determined by the source, and is usually not documented as part of the MAVLink specification."]
29546#[derive(Debug, Clone, PartialEq)]
29547#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29548#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29549pub struct TUNNEL_DATA {
29550 #[doc = "A code that identifies the content of the payload (0 for unknown, which is the default). If this code is less than 32768, it is a 'registered' payload type and the corresponding code should be added to the MAV_TUNNEL_PAYLOAD_TYPE enum. Software creators can register blocks of types as needed. Codes greater than 32767 are considered local experiments and should not be checked in to any widely distributed codebase."]
29551 pub payload_type: MavTunnelPayloadType,
29552 #[doc = "System ID (can be 0 for broadcast, but this is discouraged)"]
29553 pub target_system: u8,
29554 #[doc = "Component ID (can be 0 for broadcast, but this is discouraged)"]
29555 pub target_component: u8,
29556 #[doc = "Length of the data transported in payload"]
29557 pub payload_length: u8,
29558 #[doc = "Variable length payload. The payload length is defined by payload_length. The entire content of this block is opaque unless you understand the encoding specified by payload_type."]
29559 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29560 pub payload: [u8; 128],
29561}
29562impl TUNNEL_DATA {
29563 pub const ENCODED_LEN: usize = 133usize;
29564 pub const DEFAULT: Self = Self {
29565 payload_type: MavTunnelPayloadType::DEFAULT,
29566 target_system: 0_u8,
29567 target_component: 0_u8,
29568 payload_length: 0_u8,
29569 payload: [0_u8; 128usize],
29570 };
29571 #[cfg(feature = "arbitrary")]
29572 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29573 use arbitrary::{Arbitrary, Unstructured};
29574 let mut buf = [0u8; 1024];
29575 rng.fill_bytes(&mut buf);
29576 let mut unstructured = Unstructured::new(&buf);
29577 Self::arbitrary(&mut unstructured).unwrap_or_default()
29578 }
29579}
29580impl Default for TUNNEL_DATA {
29581 fn default() -> Self {
29582 Self::DEFAULT.clone()
29583 }
29584}
29585impl MessageData for TUNNEL_DATA {
29586 type Message = MavMessage;
29587 const ID: u32 = 385u32;
29588 const NAME: &'static str = "TUNNEL";
29589 const EXTRA_CRC: u8 = 147u8;
29590 const ENCODED_LEN: usize = 133usize;
29591 fn deser(
29592 _version: MavlinkVersion,
29593 __input: &[u8],
29594 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29595 let avail_len = __input.len();
29596 let mut payload_buf = [0; Self::ENCODED_LEN];
29597 let mut buf = if avail_len < Self::ENCODED_LEN {
29598 payload_buf[0..avail_len].copy_from_slice(__input);
29599 Bytes::new(&payload_buf)
29600 } else {
29601 Bytes::new(__input)
29602 };
29603 let mut __struct = Self::default();
29604 let tmp = buf.get_u16_le();
29605 __struct.payload_type = FromPrimitive::from_u16(tmp).ok_or(
29606 ::mavlink_core::error::ParserError::InvalidEnum {
29607 enum_type: "MavTunnelPayloadType",
29608 value: tmp as u32,
29609 },
29610 )?;
29611 __struct.target_system = buf.get_u8();
29612 __struct.target_component = buf.get_u8();
29613 __struct.payload_length = buf.get_u8();
29614 for v in &mut __struct.payload {
29615 let val = buf.get_u8();
29616 *v = val;
29617 }
29618 Ok(__struct)
29619 }
29620 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29621 let mut __tmp = BytesMut::new(bytes);
29622 #[allow(clippy::absurd_extreme_comparisons)]
29623 #[allow(unused_comparisons)]
29624 if __tmp.remaining() < Self::ENCODED_LEN {
29625 panic!(
29626 "buffer is too small (need {} bytes, but got {})",
29627 Self::ENCODED_LEN,
29628 __tmp.remaining(),
29629 )
29630 }
29631 __tmp.put_u16_le(self.payload_type as u16);
29632 __tmp.put_u8(self.target_system);
29633 __tmp.put_u8(self.target_component);
29634 __tmp.put_u8(self.payload_length);
29635 for val in &self.payload {
29636 __tmp.put_u8(*val);
29637 }
29638 if matches!(version, MavlinkVersion::V2) {
29639 let len = __tmp.len();
29640 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29641 } else {
29642 __tmp.len()
29643 }
29644 }
29645}
29646#[doc = "id: 311"]
29647#[doc = "General information describing a particular UAVCAN node. Please refer to the definition of the UAVCAN service \"uavcan.protocol.GetNodeInfo\" for the background information. This message should be emitted by the system whenever a new node appears online, or an existing node reboots. Additionally, it can be emitted upon request from the other end of the MAVLink channel (see MAV_CMD_UAVCAN_GET_NODE_INFO). It is also not prohibited to emit this message unconditionally at a low frequency. The UAVCAN specification is available at <http://uavcan.org>."]
29648#[derive(Debug, Clone, PartialEq)]
29649#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29650#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29651pub struct UAVCAN_NODE_INFO_DATA {
29652 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
29653 pub time_usec: u64,
29654 #[doc = "Time since the start-up of the node."]
29655 pub uptime_sec: u32,
29656 #[doc = "Version control system (VCS) revision identifier (e.g. git short commit hash). 0 if unknown."]
29657 pub sw_vcs_commit: u32,
29658 #[doc = "Node name string. For example, \"sapog.px4.io\"."]
29659 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29660 pub name: [u8; 80],
29661 #[doc = "Hardware major version number."]
29662 pub hw_version_major: u8,
29663 #[doc = "Hardware minor version number."]
29664 pub hw_version_minor: u8,
29665 #[doc = "Hardware unique 128-bit ID."]
29666 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29667 pub hw_unique_id: [u8; 16],
29668 #[doc = "Software major version number."]
29669 pub sw_version_major: u8,
29670 #[doc = "Software minor version number."]
29671 pub sw_version_minor: u8,
29672}
29673impl UAVCAN_NODE_INFO_DATA {
29674 pub const ENCODED_LEN: usize = 116usize;
29675 pub const DEFAULT: Self = Self {
29676 time_usec: 0_u64,
29677 uptime_sec: 0_u32,
29678 sw_vcs_commit: 0_u32,
29679 name: [0_u8; 80usize],
29680 hw_version_major: 0_u8,
29681 hw_version_minor: 0_u8,
29682 hw_unique_id: [0_u8; 16usize],
29683 sw_version_major: 0_u8,
29684 sw_version_minor: 0_u8,
29685 };
29686 #[cfg(feature = "arbitrary")]
29687 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29688 use arbitrary::{Arbitrary, Unstructured};
29689 let mut buf = [0u8; 1024];
29690 rng.fill_bytes(&mut buf);
29691 let mut unstructured = Unstructured::new(&buf);
29692 Self::arbitrary(&mut unstructured).unwrap_or_default()
29693 }
29694}
29695impl Default for UAVCAN_NODE_INFO_DATA {
29696 fn default() -> Self {
29697 Self::DEFAULT.clone()
29698 }
29699}
29700impl MessageData for UAVCAN_NODE_INFO_DATA {
29701 type Message = MavMessage;
29702 const ID: u32 = 311u32;
29703 const NAME: &'static str = "UAVCAN_NODE_INFO";
29704 const EXTRA_CRC: u8 = 95u8;
29705 const ENCODED_LEN: usize = 116usize;
29706 fn deser(
29707 _version: MavlinkVersion,
29708 __input: &[u8],
29709 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29710 let avail_len = __input.len();
29711 let mut payload_buf = [0; Self::ENCODED_LEN];
29712 let mut buf = if avail_len < Self::ENCODED_LEN {
29713 payload_buf[0..avail_len].copy_from_slice(__input);
29714 Bytes::new(&payload_buf)
29715 } else {
29716 Bytes::new(__input)
29717 };
29718 let mut __struct = Self::default();
29719 __struct.time_usec = buf.get_u64_le();
29720 __struct.uptime_sec = buf.get_u32_le();
29721 __struct.sw_vcs_commit = buf.get_u32_le();
29722 for v in &mut __struct.name {
29723 let val = buf.get_u8();
29724 *v = val;
29725 }
29726 __struct.hw_version_major = buf.get_u8();
29727 __struct.hw_version_minor = buf.get_u8();
29728 for v in &mut __struct.hw_unique_id {
29729 let val = buf.get_u8();
29730 *v = val;
29731 }
29732 __struct.sw_version_major = buf.get_u8();
29733 __struct.sw_version_minor = buf.get_u8();
29734 Ok(__struct)
29735 }
29736 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29737 let mut __tmp = BytesMut::new(bytes);
29738 #[allow(clippy::absurd_extreme_comparisons)]
29739 #[allow(unused_comparisons)]
29740 if __tmp.remaining() < Self::ENCODED_LEN {
29741 panic!(
29742 "buffer is too small (need {} bytes, but got {})",
29743 Self::ENCODED_LEN,
29744 __tmp.remaining(),
29745 )
29746 }
29747 __tmp.put_u64_le(self.time_usec);
29748 __tmp.put_u32_le(self.uptime_sec);
29749 __tmp.put_u32_le(self.sw_vcs_commit);
29750 for val in &self.name {
29751 __tmp.put_u8(*val);
29752 }
29753 __tmp.put_u8(self.hw_version_major);
29754 __tmp.put_u8(self.hw_version_minor);
29755 for val in &self.hw_unique_id {
29756 __tmp.put_u8(*val);
29757 }
29758 __tmp.put_u8(self.sw_version_major);
29759 __tmp.put_u8(self.sw_version_minor);
29760 if matches!(version, MavlinkVersion::V2) {
29761 let len = __tmp.len();
29762 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29763 } else {
29764 __tmp.len()
29765 }
29766 }
29767}
29768#[doc = "id: 310"]
29769#[doc = "General status information of an UAVCAN node. Please refer to the definition of the UAVCAN message \"uavcan.protocol.NodeStatus\" for the background information. The UAVCAN specification is available at <http://uavcan.org>."]
29770#[derive(Debug, Clone, PartialEq)]
29771#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29772#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29773pub struct UAVCAN_NODE_STATUS_DATA {
29774 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
29775 pub time_usec: u64,
29776 #[doc = "Time since the start-up of the node."]
29777 pub uptime_sec: u32,
29778 #[doc = "Vendor-specific status information."]
29779 pub vendor_specific_status_code: u16,
29780 #[doc = "Generalized node health status."]
29781 pub health: UavcanNodeHealth,
29782 #[doc = "Generalized operating mode."]
29783 pub mode: UavcanNodeMode,
29784 #[doc = "Not used currently."]
29785 pub sub_mode: u8,
29786}
29787impl UAVCAN_NODE_STATUS_DATA {
29788 pub const ENCODED_LEN: usize = 17usize;
29789 pub const DEFAULT: Self = Self {
29790 time_usec: 0_u64,
29791 uptime_sec: 0_u32,
29792 vendor_specific_status_code: 0_u16,
29793 health: UavcanNodeHealth::DEFAULT,
29794 mode: UavcanNodeMode::DEFAULT,
29795 sub_mode: 0_u8,
29796 };
29797 #[cfg(feature = "arbitrary")]
29798 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29799 use arbitrary::{Arbitrary, Unstructured};
29800 let mut buf = [0u8; 1024];
29801 rng.fill_bytes(&mut buf);
29802 let mut unstructured = Unstructured::new(&buf);
29803 Self::arbitrary(&mut unstructured).unwrap_or_default()
29804 }
29805}
29806impl Default for UAVCAN_NODE_STATUS_DATA {
29807 fn default() -> Self {
29808 Self::DEFAULT.clone()
29809 }
29810}
29811impl MessageData for UAVCAN_NODE_STATUS_DATA {
29812 type Message = MavMessage;
29813 const ID: u32 = 310u32;
29814 const NAME: &'static str = "UAVCAN_NODE_STATUS";
29815 const EXTRA_CRC: u8 = 28u8;
29816 const ENCODED_LEN: usize = 17usize;
29817 fn deser(
29818 _version: MavlinkVersion,
29819 __input: &[u8],
29820 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29821 let avail_len = __input.len();
29822 let mut payload_buf = [0; Self::ENCODED_LEN];
29823 let mut buf = if avail_len < Self::ENCODED_LEN {
29824 payload_buf[0..avail_len].copy_from_slice(__input);
29825 Bytes::new(&payload_buf)
29826 } else {
29827 Bytes::new(__input)
29828 };
29829 let mut __struct = Self::default();
29830 __struct.time_usec = buf.get_u64_le();
29831 __struct.uptime_sec = buf.get_u32_le();
29832 __struct.vendor_specific_status_code = buf.get_u16_le();
29833 let tmp = buf.get_u8();
29834 __struct.health =
29835 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
29836 enum_type: "UavcanNodeHealth",
29837 value: tmp as u32,
29838 })?;
29839 let tmp = buf.get_u8();
29840 __struct.mode =
29841 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
29842 enum_type: "UavcanNodeMode",
29843 value: tmp as u32,
29844 })?;
29845 __struct.sub_mode = buf.get_u8();
29846 Ok(__struct)
29847 }
29848 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29849 let mut __tmp = BytesMut::new(bytes);
29850 #[allow(clippy::absurd_extreme_comparisons)]
29851 #[allow(unused_comparisons)]
29852 if __tmp.remaining() < Self::ENCODED_LEN {
29853 panic!(
29854 "buffer is too small (need {} bytes, but got {})",
29855 Self::ENCODED_LEN,
29856 __tmp.remaining(),
29857 )
29858 }
29859 __tmp.put_u64_le(self.time_usec);
29860 __tmp.put_u32_le(self.uptime_sec);
29861 __tmp.put_u16_le(self.vendor_specific_status_code);
29862 __tmp.put_u8(self.health as u8);
29863 __tmp.put_u8(self.mode as u8);
29864 __tmp.put_u8(self.sub_mode);
29865 if matches!(version, MavlinkVersion::V2) {
29866 let len = __tmp.len();
29867 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29868 } else {
29869 __tmp.len()
29870 }
29871 }
29872}
29873#[doc = "id: 340"]
29874#[doc = "The global position resulting from GPS and sensor fusion."]
29875#[derive(Debug, Clone, PartialEq)]
29876#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29877#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29878pub struct UTM_GLOBAL_POSITION_DATA {
29879 #[doc = "Time of applicability of position (microseconds since UNIX epoch)."]
29880 pub time: u64,
29881 #[doc = "Latitude (WGS84)"]
29882 pub lat: i32,
29883 #[doc = "Longitude (WGS84)"]
29884 pub lon: i32,
29885 #[doc = "Altitude (WGS84)"]
29886 pub alt: i32,
29887 #[doc = "Altitude above ground"]
29888 pub relative_alt: i32,
29889 #[doc = "Next waypoint, latitude (WGS84)"]
29890 pub next_lat: i32,
29891 #[doc = "Next waypoint, longitude (WGS84)"]
29892 pub next_lon: i32,
29893 #[doc = "Next waypoint, altitude (WGS84)"]
29894 pub next_alt: i32,
29895 #[doc = "Ground X speed (latitude, positive north)"]
29896 pub vx: i16,
29897 #[doc = "Ground Y speed (longitude, positive east)"]
29898 pub vy: i16,
29899 #[doc = "Ground Z speed (altitude, positive down)"]
29900 pub vz: i16,
29901 #[doc = "Horizontal position uncertainty (standard deviation)"]
29902 pub h_acc: u16,
29903 #[doc = "Altitude uncertainty (standard deviation)"]
29904 pub v_acc: u16,
29905 #[doc = "Speed uncertainty (standard deviation)"]
29906 pub vel_acc: u16,
29907 #[doc = "Time until next update. Set to 0 if unknown or in data driven mode."]
29908 pub update_rate: u16,
29909 #[doc = "Unique UAS ID."]
29910 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29911 pub uas_id: [u8; 18],
29912 #[doc = "Flight state"]
29913 pub flight_state: UtmFlightState,
29914 #[doc = "Bitwise OR combination of the data available flags."]
29915 pub flags: UtmDataAvailFlags,
29916}
29917impl UTM_GLOBAL_POSITION_DATA {
29918 pub const ENCODED_LEN: usize = 70usize;
29919 pub const DEFAULT: Self = Self {
29920 time: 0_u64,
29921 lat: 0_i32,
29922 lon: 0_i32,
29923 alt: 0_i32,
29924 relative_alt: 0_i32,
29925 next_lat: 0_i32,
29926 next_lon: 0_i32,
29927 next_alt: 0_i32,
29928 vx: 0_i16,
29929 vy: 0_i16,
29930 vz: 0_i16,
29931 h_acc: 0_u16,
29932 v_acc: 0_u16,
29933 vel_acc: 0_u16,
29934 update_rate: 0_u16,
29935 uas_id: [0_u8; 18usize],
29936 flight_state: UtmFlightState::DEFAULT,
29937 flags: UtmDataAvailFlags::DEFAULT,
29938 };
29939 #[cfg(feature = "arbitrary")]
29940 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29941 use arbitrary::{Arbitrary, Unstructured};
29942 let mut buf = [0u8; 1024];
29943 rng.fill_bytes(&mut buf);
29944 let mut unstructured = Unstructured::new(&buf);
29945 Self::arbitrary(&mut unstructured).unwrap_or_default()
29946 }
29947}
29948impl Default for UTM_GLOBAL_POSITION_DATA {
29949 fn default() -> Self {
29950 Self::DEFAULT.clone()
29951 }
29952}
29953impl MessageData for UTM_GLOBAL_POSITION_DATA {
29954 type Message = MavMessage;
29955 const ID: u32 = 340u32;
29956 const NAME: &'static str = "UTM_GLOBAL_POSITION";
29957 const EXTRA_CRC: u8 = 99u8;
29958 const ENCODED_LEN: usize = 70usize;
29959 fn deser(
29960 _version: MavlinkVersion,
29961 __input: &[u8],
29962 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29963 let avail_len = __input.len();
29964 let mut payload_buf = [0; Self::ENCODED_LEN];
29965 let mut buf = if avail_len < Self::ENCODED_LEN {
29966 payload_buf[0..avail_len].copy_from_slice(__input);
29967 Bytes::new(&payload_buf)
29968 } else {
29969 Bytes::new(__input)
29970 };
29971 let mut __struct = Self::default();
29972 __struct.time = buf.get_u64_le();
29973 __struct.lat = buf.get_i32_le();
29974 __struct.lon = buf.get_i32_le();
29975 __struct.alt = buf.get_i32_le();
29976 __struct.relative_alt = buf.get_i32_le();
29977 __struct.next_lat = buf.get_i32_le();
29978 __struct.next_lon = buf.get_i32_le();
29979 __struct.next_alt = buf.get_i32_le();
29980 __struct.vx = buf.get_i16_le();
29981 __struct.vy = buf.get_i16_le();
29982 __struct.vz = buf.get_i16_le();
29983 __struct.h_acc = buf.get_u16_le();
29984 __struct.v_acc = buf.get_u16_le();
29985 __struct.vel_acc = buf.get_u16_le();
29986 __struct.update_rate = buf.get_u16_le();
29987 for v in &mut __struct.uas_id {
29988 let val = buf.get_u8();
29989 *v = val;
29990 }
29991 let tmp = buf.get_u8();
29992 __struct.flight_state =
29993 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
29994 enum_type: "UtmFlightState",
29995 value: tmp as u32,
29996 })?;
29997 let tmp = buf.get_u8();
29998 __struct.flags = UtmDataAvailFlags::from_bits(tmp & UtmDataAvailFlags::all().bits())
29999 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
30000 flag_type: "UtmDataAvailFlags",
30001 value: tmp as u32,
30002 })?;
30003 Ok(__struct)
30004 }
30005 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30006 let mut __tmp = BytesMut::new(bytes);
30007 #[allow(clippy::absurd_extreme_comparisons)]
30008 #[allow(unused_comparisons)]
30009 if __tmp.remaining() < Self::ENCODED_LEN {
30010 panic!(
30011 "buffer is too small (need {} bytes, but got {})",
30012 Self::ENCODED_LEN,
30013 __tmp.remaining(),
30014 )
30015 }
30016 __tmp.put_u64_le(self.time);
30017 __tmp.put_i32_le(self.lat);
30018 __tmp.put_i32_le(self.lon);
30019 __tmp.put_i32_le(self.alt);
30020 __tmp.put_i32_le(self.relative_alt);
30021 __tmp.put_i32_le(self.next_lat);
30022 __tmp.put_i32_le(self.next_lon);
30023 __tmp.put_i32_le(self.next_alt);
30024 __tmp.put_i16_le(self.vx);
30025 __tmp.put_i16_le(self.vy);
30026 __tmp.put_i16_le(self.vz);
30027 __tmp.put_u16_le(self.h_acc);
30028 __tmp.put_u16_le(self.v_acc);
30029 __tmp.put_u16_le(self.vel_acc);
30030 __tmp.put_u16_le(self.update_rate);
30031 for val in &self.uas_id {
30032 __tmp.put_u8(*val);
30033 }
30034 __tmp.put_u8(self.flight_state as u8);
30035 __tmp.put_u8(self.flags.bits());
30036 if matches!(version, MavlinkVersion::V2) {
30037 let len = __tmp.len();
30038 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30039 } else {
30040 __tmp.len()
30041 }
30042 }
30043}
30044#[doc = "id: 248"]
30045#[doc = "Message implementing parts of the V2 payload specs in V1 frames for transitional support."]
30046#[derive(Debug, Clone, PartialEq)]
30047#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30048#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30049pub struct V2_EXTENSION_DATA {
30050 #[doc = "A code that identifies the software component that understands this message (analogous to USB device classes or mime type strings). If this code is less than 32768, it is considered a 'registered' protocol extension and the corresponding entry should be added to <https://github.com/mavlink/mavlink/definition_files/extension_message_ids.xml>. Software creators can register blocks of message IDs as needed (useful for GCS specific metadata, etc...). Message_types greater than 32767 are considered local experiments and should not be checked in to any widely distributed codebase."]
30051 pub message_type: u16,
30052 #[doc = "Network ID (0 for broadcast)"]
30053 pub target_network: u8,
30054 #[doc = "System ID (0 for broadcast)"]
30055 pub target_system: u8,
30056 #[doc = "Component ID (0 for broadcast)"]
30057 pub target_component: u8,
30058 #[doc = "Variable length payload. The length must be encoded in the payload as part of the message_type protocol, e.g. by including the length as payload data, or by terminating the payload data with a non-zero marker. This is required in order to reconstruct zero-terminated payloads that are (or otherwise would be) trimmed by MAVLink 2 empty-byte truncation. The entire content of the payload block is opaque unless you understand the encoding message_type. The particular encoding used can be extension specific and might not always be documented as part of the MAVLink specification."]
30059 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30060 pub payload: [u8; 249],
30061}
30062impl V2_EXTENSION_DATA {
30063 pub const ENCODED_LEN: usize = 254usize;
30064 pub const DEFAULT: Self = Self {
30065 message_type: 0_u16,
30066 target_network: 0_u8,
30067 target_system: 0_u8,
30068 target_component: 0_u8,
30069 payload: [0_u8; 249usize],
30070 };
30071 #[cfg(feature = "arbitrary")]
30072 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30073 use arbitrary::{Arbitrary, Unstructured};
30074 let mut buf = [0u8; 1024];
30075 rng.fill_bytes(&mut buf);
30076 let mut unstructured = Unstructured::new(&buf);
30077 Self::arbitrary(&mut unstructured).unwrap_or_default()
30078 }
30079}
30080impl Default for V2_EXTENSION_DATA {
30081 fn default() -> Self {
30082 Self::DEFAULT.clone()
30083 }
30084}
30085impl MessageData for V2_EXTENSION_DATA {
30086 type Message = MavMessage;
30087 const ID: u32 = 248u32;
30088 const NAME: &'static str = "V2_EXTENSION";
30089 const EXTRA_CRC: u8 = 8u8;
30090 const ENCODED_LEN: usize = 254usize;
30091 fn deser(
30092 _version: MavlinkVersion,
30093 __input: &[u8],
30094 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30095 let avail_len = __input.len();
30096 let mut payload_buf = [0; Self::ENCODED_LEN];
30097 let mut buf = if avail_len < Self::ENCODED_LEN {
30098 payload_buf[0..avail_len].copy_from_slice(__input);
30099 Bytes::new(&payload_buf)
30100 } else {
30101 Bytes::new(__input)
30102 };
30103 let mut __struct = Self::default();
30104 __struct.message_type = buf.get_u16_le();
30105 __struct.target_network = buf.get_u8();
30106 __struct.target_system = buf.get_u8();
30107 __struct.target_component = buf.get_u8();
30108 for v in &mut __struct.payload {
30109 let val = buf.get_u8();
30110 *v = val;
30111 }
30112 Ok(__struct)
30113 }
30114 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30115 let mut __tmp = BytesMut::new(bytes);
30116 #[allow(clippy::absurd_extreme_comparisons)]
30117 #[allow(unused_comparisons)]
30118 if __tmp.remaining() < Self::ENCODED_LEN {
30119 panic!(
30120 "buffer is too small (need {} bytes, but got {})",
30121 Self::ENCODED_LEN,
30122 __tmp.remaining(),
30123 )
30124 }
30125 __tmp.put_u16_le(self.message_type);
30126 __tmp.put_u8(self.target_network);
30127 __tmp.put_u8(self.target_system);
30128 __tmp.put_u8(self.target_component);
30129 for val in &self.payload {
30130 __tmp.put_u8(*val);
30131 }
30132 if matches!(version, MavlinkVersion::V2) {
30133 let len = __tmp.len();
30134 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30135 } else {
30136 __tmp.len()
30137 }
30138 }
30139}
30140#[doc = "id: 74"]
30141#[doc = "Metrics typically displayed on a HUD for fixed wing aircraft."]
30142#[derive(Debug, Clone, PartialEq)]
30143#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30144#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30145pub struct VFR_HUD_DATA {
30146 #[doc = "Vehicle speed in form appropriate for vehicle type. For standard aircraft this is typically calibrated airspeed (CAS) or indicated airspeed (IAS) - either of which can be used by a pilot to estimate stall speed."]
30147 pub airspeed: f32,
30148 #[doc = "Current ground speed."]
30149 pub groundspeed: f32,
30150 #[doc = "Current altitude (MSL)."]
30151 pub alt: f32,
30152 #[doc = "Current climb rate."]
30153 pub climb: f32,
30154 #[doc = "Current heading in compass units (0-360, 0=north)."]
30155 pub heading: i16,
30156 #[doc = "Current throttle setting (0 to 100)."]
30157 pub throttle: u16,
30158}
30159impl VFR_HUD_DATA {
30160 pub const ENCODED_LEN: usize = 20usize;
30161 pub const DEFAULT: Self = Self {
30162 airspeed: 0.0_f32,
30163 groundspeed: 0.0_f32,
30164 alt: 0.0_f32,
30165 climb: 0.0_f32,
30166 heading: 0_i16,
30167 throttle: 0_u16,
30168 };
30169 #[cfg(feature = "arbitrary")]
30170 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30171 use arbitrary::{Arbitrary, Unstructured};
30172 let mut buf = [0u8; 1024];
30173 rng.fill_bytes(&mut buf);
30174 let mut unstructured = Unstructured::new(&buf);
30175 Self::arbitrary(&mut unstructured).unwrap_or_default()
30176 }
30177}
30178impl Default for VFR_HUD_DATA {
30179 fn default() -> Self {
30180 Self::DEFAULT.clone()
30181 }
30182}
30183impl MessageData for VFR_HUD_DATA {
30184 type Message = MavMessage;
30185 const ID: u32 = 74u32;
30186 const NAME: &'static str = "VFR_HUD";
30187 const EXTRA_CRC: u8 = 20u8;
30188 const ENCODED_LEN: usize = 20usize;
30189 fn deser(
30190 _version: MavlinkVersion,
30191 __input: &[u8],
30192 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30193 let avail_len = __input.len();
30194 let mut payload_buf = [0; Self::ENCODED_LEN];
30195 let mut buf = if avail_len < Self::ENCODED_LEN {
30196 payload_buf[0..avail_len].copy_from_slice(__input);
30197 Bytes::new(&payload_buf)
30198 } else {
30199 Bytes::new(__input)
30200 };
30201 let mut __struct = Self::default();
30202 __struct.airspeed = buf.get_f32_le();
30203 __struct.groundspeed = buf.get_f32_le();
30204 __struct.alt = buf.get_f32_le();
30205 __struct.climb = buf.get_f32_le();
30206 __struct.heading = buf.get_i16_le();
30207 __struct.throttle = buf.get_u16_le();
30208 Ok(__struct)
30209 }
30210 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30211 let mut __tmp = BytesMut::new(bytes);
30212 #[allow(clippy::absurd_extreme_comparisons)]
30213 #[allow(unused_comparisons)]
30214 if __tmp.remaining() < Self::ENCODED_LEN {
30215 panic!(
30216 "buffer is too small (need {} bytes, but got {})",
30217 Self::ENCODED_LEN,
30218 __tmp.remaining(),
30219 )
30220 }
30221 __tmp.put_f32_le(self.airspeed);
30222 __tmp.put_f32_le(self.groundspeed);
30223 __tmp.put_f32_le(self.alt);
30224 __tmp.put_f32_le(self.climb);
30225 __tmp.put_i16_le(self.heading);
30226 __tmp.put_u16_le(self.throttle);
30227 if matches!(version, MavlinkVersion::V2) {
30228 let len = __tmp.len();
30229 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30230 } else {
30231 __tmp.len()
30232 }
30233 }
30234}
30235#[doc = "id: 241"]
30236#[doc = "Vibration levels and accelerometer clipping."]
30237#[derive(Debug, Clone, PartialEq)]
30238#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30239#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30240pub struct VIBRATION_DATA {
30241 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
30242 pub time_usec: u64,
30243 #[doc = "Vibration levels on X-axis"]
30244 pub vibration_x: f32,
30245 #[doc = "Vibration levels on Y-axis"]
30246 pub vibration_y: f32,
30247 #[doc = "Vibration levels on Z-axis"]
30248 pub vibration_z: f32,
30249 #[doc = "first accelerometer clipping count"]
30250 pub clipping_0: u32,
30251 #[doc = "second accelerometer clipping count"]
30252 pub clipping_1: u32,
30253 #[doc = "third accelerometer clipping count"]
30254 pub clipping_2: u32,
30255}
30256impl VIBRATION_DATA {
30257 pub const ENCODED_LEN: usize = 32usize;
30258 pub const DEFAULT: Self = Self {
30259 time_usec: 0_u64,
30260 vibration_x: 0.0_f32,
30261 vibration_y: 0.0_f32,
30262 vibration_z: 0.0_f32,
30263 clipping_0: 0_u32,
30264 clipping_1: 0_u32,
30265 clipping_2: 0_u32,
30266 };
30267 #[cfg(feature = "arbitrary")]
30268 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30269 use arbitrary::{Arbitrary, Unstructured};
30270 let mut buf = [0u8; 1024];
30271 rng.fill_bytes(&mut buf);
30272 let mut unstructured = Unstructured::new(&buf);
30273 Self::arbitrary(&mut unstructured).unwrap_or_default()
30274 }
30275}
30276impl Default for VIBRATION_DATA {
30277 fn default() -> Self {
30278 Self::DEFAULT.clone()
30279 }
30280}
30281impl MessageData for VIBRATION_DATA {
30282 type Message = MavMessage;
30283 const ID: u32 = 241u32;
30284 const NAME: &'static str = "VIBRATION";
30285 const EXTRA_CRC: u8 = 90u8;
30286 const ENCODED_LEN: usize = 32usize;
30287 fn deser(
30288 _version: MavlinkVersion,
30289 __input: &[u8],
30290 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30291 let avail_len = __input.len();
30292 let mut payload_buf = [0; Self::ENCODED_LEN];
30293 let mut buf = if avail_len < Self::ENCODED_LEN {
30294 payload_buf[0..avail_len].copy_from_slice(__input);
30295 Bytes::new(&payload_buf)
30296 } else {
30297 Bytes::new(__input)
30298 };
30299 let mut __struct = Self::default();
30300 __struct.time_usec = buf.get_u64_le();
30301 __struct.vibration_x = buf.get_f32_le();
30302 __struct.vibration_y = buf.get_f32_le();
30303 __struct.vibration_z = buf.get_f32_le();
30304 __struct.clipping_0 = buf.get_u32_le();
30305 __struct.clipping_1 = buf.get_u32_le();
30306 __struct.clipping_2 = buf.get_u32_le();
30307 Ok(__struct)
30308 }
30309 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30310 let mut __tmp = BytesMut::new(bytes);
30311 #[allow(clippy::absurd_extreme_comparisons)]
30312 #[allow(unused_comparisons)]
30313 if __tmp.remaining() < Self::ENCODED_LEN {
30314 panic!(
30315 "buffer is too small (need {} bytes, but got {})",
30316 Self::ENCODED_LEN,
30317 __tmp.remaining(),
30318 )
30319 }
30320 __tmp.put_u64_le(self.time_usec);
30321 __tmp.put_f32_le(self.vibration_x);
30322 __tmp.put_f32_le(self.vibration_y);
30323 __tmp.put_f32_le(self.vibration_z);
30324 __tmp.put_u32_le(self.clipping_0);
30325 __tmp.put_u32_le(self.clipping_1);
30326 __tmp.put_u32_le(self.clipping_2);
30327 if matches!(version, MavlinkVersion::V2) {
30328 let len = __tmp.len();
30329 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30330 } else {
30331 __tmp.len()
30332 }
30333 }
30334}
30335#[doc = "id: 104"]
30336#[doc = "Global position estimate from a Vicon motion system source."]
30337#[derive(Debug, Clone, PartialEq)]
30338#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30339#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30340pub struct VICON_POSITION_ESTIMATE_DATA {
30341 #[doc = "Timestamp (UNIX time or time since system boot)"]
30342 pub usec: u64,
30343 #[doc = "Global X position"]
30344 pub x: f32,
30345 #[doc = "Global Y position"]
30346 pub y: f32,
30347 #[doc = "Global Z position"]
30348 pub z: f32,
30349 #[doc = "Roll angle"]
30350 pub roll: f32,
30351 #[doc = "Pitch angle"]
30352 pub pitch: f32,
30353 #[doc = "Yaw angle"]
30354 pub yaw: f32,
30355 #[doc = "Row-major representation of 6x6 pose cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
30356 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
30357 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30358 pub covariance: [f32; 21],
30359}
30360impl VICON_POSITION_ESTIMATE_DATA {
30361 pub const ENCODED_LEN: usize = 116usize;
30362 pub const DEFAULT: Self = Self {
30363 usec: 0_u64,
30364 x: 0.0_f32,
30365 y: 0.0_f32,
30366 z: 0.0_f32,
30367 roll: 0.0_f32,
30368 pitch: 0.0_f32,
30369 yaw: 0.0_f32,
30370 covariance: [0.0_f32; 21usize],
30371 };
30372 #[cfg(feature = "arbitrary")]
30373 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30374 use arbitrary::{Arbitrary, Unstructured};
30375 let mut buf = [0u8; 1024];
30376 rng.fill_bytes(&mut buf);
30377 let mut unstructured = Unstructured::new(&buf);
30378 Self::arbitrary(&mut unstructured).unwrap_or_default()
30379 }
30380}
30381impl Default for VICON_POSITION_ESTIMATE_DATA {
30382 fn default() -> Self {
30383 Self::DEFAULT.clone()
30384 }
30385}
30386impl MessageData for VICON_POSITION_ESTIMATE_DATA {
30387 type Message = MavMessage;
30388 const ID: u32 = 104u32;
30389 const NAME: &'static str = "VICON_POSITION_ESTIMATE";
30390 const EXTRA_CRC: u8 = 56u8;
30391 const ENCODED_LEN: usize = 116usize;
30392 fn deser(
30393 _version: MavlinkVersion,
30394 __input: &[u8],
30395 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30396 let avail_len = __input.len();
30397 let mut payload_buf = [0; Self::ENCODED_LEN];
30398 let mut buf = if avail_len < Self::ENCODED_LEN {
30399 payload_buf[0..avail_len].copy_from_slice(__input);
30400 Bytes::new(&payload_buf)
30401 } else {
30402 Bytes::new(__input)
30403 };
30404 let mut __struct = Self::default();
30405 __struct.usec = buf.get_u64_le();
30406 __struct.x = buf.get_f32_le();
30407 __struct.y = buf.get_f32_le();
30408 __struct.z = buf.get_f32_le();
30409 __struct.roll = buf.get_f32_le();
30410 __struct.pitch = buf.get_f32_le();
30411 __struct.yaw = buf.get_f32_le();
30412 for v in &mut __struct.covariance {
30413 let val = buf.get_f32_le();
30414 *v = val;
30415 }
30416 Ok(__struct)
30417 }
30418 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30419 let mut __tmp = BytesMut::new(bytes);
30420 #[allow(clippy::absurd_extreme_comparisons)]
30421 #[allow(unused_comparisons)]
30422 if __tmp.remaining() < Self::ENCODED_LEN {
30423 panic!(
30424 "buffer is too small (need {} bytes, but got {})",
30425 Self::ENCODED_LEN,
30426 __tmp.remaining(),
30427 )
30428 }
30429 __tmp.put_u64_le(self.usec);
30430 __tmp.put_f32_le(self.x);
30431 __tmp.put_f32_le(self.y);
30432 __tmp.put_f32_le(self.z);
30433 __tmp.put_f32_le(self.roll);
30434 __tmp.put_f32_le(self.pitch);
30435 __tmp.put_f32_le(self.yaw);
30436 for val in &self.covariance {
30437 __tmp.put_f32_le(*val);
30438 }
30439 if matches!(version, MavlinkVersion::V2) {
30440 let len = __tmp.len();
30441 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30442 } else {
30443 __tmp.len()
30444 }
30445 }
30446}
30447#[doc = "id: 269"]
30448#[doc = "Information about video stream. It may be requested using MAV_CMD_REQUEST_MESSAGE, where param2 indicates the video stream id: 0 for all streams, 1 for first, 2 for second, etc."]
30449#[derive(Debug, Clone, PartialEq)]
30450#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30451#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30452pub struct VIDEO_STREAM_INFORMATION_DATA {
30453 #[doc = "Frame rate."]
30454 pub framerate: f32,
30455 #[doc = "Bit rate."]
30456 pub bitrate: u32,
30457 #[doc = "Bitmap of stream status flags."]
30458 pub flags: VideoStreamStatusFlags,
30459 #[doc = "Horizontal resolution."]
30460 pub resolution_h: u16,
30461 #[doc = "Vertical resolution."]
30462 pub resolution_v: u16,
30463 #[doc = "Video image rotation clockwise."]
30464 pub rotation: u16,
30465 #[doc = "Horizontal Field of view."]
30466 pub hfov: u16,
30467 #[doc = "Video Stream ID (1 for first, 2 for second, etc.)"]
30468 pub stream_id: u8,
30469 #[doc = "Number of streams available."]
30470 pub count: u8,
30471 #[doc = "Type of stream."]
30472 pub mavtype: VideoStreamType,
30473 #[doc = "Stream name."]
30474 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30475 pub name: [u8; 32],
30476 #[doc = "Video stream URI (TCP or RTSP URI ground station should connect to) or port number (UDP port ground station should listen to)."]
30477 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30478 pub uri: [u8; 160],
30479 #[doc = "Encoding of stream."]
30480 #[cfg_attr(feature = "serde", serde(default))]
30481 pub encoding: VideoStreamEncoding,
30482 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
30483 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
30484 pub camera_device_id: u8,
30485}
30486impl VIDEO_STREAM_INFORMATION_DATA {
30487 pub const ENCODED_LEN: usize = 215usize;
30488 pub const DEFAULT: Self = Self {
30489 framerate: 0.0_f32,
30490 bitrate: 0_u32,
30491 flags: VideoStreamStatusFlags::DEFAULT,
30492 resolution_h: 0_u16,
30493 resolution_v: 0_u16,
30494 rotation: 0_u16,
30495 hfov: 0_u16,
30496 stream_id: 0_u8,
30497 count: 0_u8,
30498 mavtype: VideoStreamType::DEFAULT,
30499 name: [0_u8; 32usize],
30500 uri: [0_u8; 160usize],
30501 encoding: VideoStreamEncoding::DEFAULT,
30502 camera_device_id: 0_u8,
30503 };
30504 #[cfg(feature = "arbitrary")]
30505 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30506 use arbitrary::{Arbitrary, Unstructured};
30507 let mut buf = [0u8; 1024];
30508 rng.fill_bytes(&mut buf);
30509 let mut unstructured = Unstructured::new(&buf);
30510 Self::arbitrary(&mut unstructured).unwrap_or_default()
30511 }
30512}
30513impl Default for VIDEO_STREAM_INFORMATION_DATA {
30514 fn default() -> Self {
30515 Self::DEFAULT.clone()
30516 }
30517}
30518impl MessageData for VIDEO_STREAM_INFORMATION_DATA {
30519 type Message = MavMessage;
30520 const ID: u32 = 269u32;
30521 const NAME: &'static str = "VIDEO_STREAM_INFORMATION";
30522 const EXTRA_CRC: u8 = 109u8;
30523 const ENCODED_LEN: usize = 215usize;
30524 fn deser(
30525 _version: MavlinkVersion,
30526 __input: &[u8],
30527 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30528 let avail_len = __input.len();
30529 let mut payload_buf = [0; Self::ENCODED_LEN];
30530 let mut buf = if avail_len < Self::ENCODED_LEN {
30531 payload_buf[0..avail_len].copy_from_slice(__input);
30532 Bytes::new(&payload_buf)
30533 } else {
30534 Bytes::new(__input)
30535 };
30536 let mut __struct = Self::default();
30537 __struct.framerate = buf.get_f32_le();
30538 __struct.bitrate = buf.get_u32_le();
30539 let tmp = buf.get_u16_le();
30540 __struct.flags = VideoStreamStatusFlags::from_bits(
30541 tmp & VideoStreamStatusFlags::all().bits(),
30542 )
30543 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
30544 flag_type: "VideoStreamStatusFlags",
30545 value: tmp as u32,
30546 })?;
30547 __struct.resolution_h = buf.get_u16_le();
30548 __struct.resolution_v = buf.get_u16_le();
30549 __struct.rotation = buf.get_u16_le();
30550 __struct.hfov = buf.get_u16_le();
30551 __struct.stream_id = buf.get_u8();
30552 __struct.count = buf.get_u8();
30553 let tmp = buf.get_u8();
30554 __struct.mavtype =
30555 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
30556 enum_type: "VideoStreamType",
30557 value: tmp as u32,
30558 })?;
30559 for v in &mut __struct.name {
30560 let val = buf.get_u8();
30561 *v = val;
30562 }
30563 for v in &mut __struct.uri {
30564 let val = buf.get_u8();
30565 *v = val;
30566 }
30567 let tmp = buf.get_u8();
30568 __struct.encoding =
30569 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
30570 enum_type: "VideoStreamEncoding",
30571 value: tmp as u32,
30572 })?;
30573 __struct.camera_device_id = buf.get_u8();
30574 Ok(__struct)
30575 }
30576 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30577 let mut __tmp = BytesMut::new(bytes);
30578 #[allow(clippy::absurd_extreme_comparisons)]
30579 #[allow(unused_comparisons)]
30580 if __tmp.remaining() < Self::ENCODED_LEN {
30581 panic!(
30582 "buffer is too small (need {} bytes, but got {})",
30583 Self::ENCODED_LEN,
30584 __tmp.remaining(),
30585 )
30586 }
30587 __tmp.put_f32_le(self.framerate);
30588 __tmp.put_u32_le(self.bitrate);
30589 __tmp.put_u16_le(self.flags.bits());
30590 __tmp.put_u16_le(self.resolution_h);
30591 __tmp.put_u16_le(self.resolution_v);
30592 __tmp.put_u16_le(self.rotation);
30593 __tmp.put_u16_le(self.hfov);
30594 __tmp.put_u8(self.stream_id);
30595 __tmp.put_u8(self.count);
30596 __tmp.put_u8(self.mavtype as u8);
30597 for val in &self.name {
30598 __tmp.put_u8(*val);
30599 }
30600 for val in &self.uri {
30601 __tmp.put_u8(*val);
30602 }
30603 __tmp.put_u8(self.encoding as u8);
30604 __tmp.put_u8(self.camera_device_id);
30605 if matches!(version, MavlinkVersion::V2) {
30606 let len = __tmp.len();
30607 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30608 } else {
30609 __tmp.len()
30610 }
30611 }
30612}
30613#[doc = "id: 270"]
30614#[doc = "Information about the status of a video stream. It may be requested using MAV_CMD_REQUEST_MESSAGE."]
30615#[derive(Debug, Clone, PartialEq)]
30616#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30617#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30618pub struct VIDEO_STREAM_STATUS_DATA {
30619 #[doc = "Frame rate"]
30620 pub framerate: f32,
30621 #[doc = "Bit rate"]
30622 pub bitrate: u32,
30623 #[doc = "Bitmap of stream status flags"]
30624 pub flags: VideoStreamStatusFlags,
30625 #[doc = "Horizontal resolution"]
30626 pub resolution_h: u16,
30627 #[doc = "Vertical resolution"]
30628 pub resolution_v: u16,
30629 #[doc = "Video image rotation clockwise"]
30630 pub rotation: u16,
30631 #[doc = "Horizontal Field of view"]
30632 pub hfov: u16,
30633 #[doc = "Video Stream ID (1 for first, 2 for second, etc.)"]
30634 pub stream_id: u8,
30635 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
30636 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
30637 pub camera_device_id: u8,
30638}
30639impl VIDEO_STREAM_STATUS_DATA {
30640 pub const ENCODED_LEN: usize = 20usize;
30641 pub const DEFAULT: Self = Self {
30642 framerate: 0.0_f32,
30643 bitrate: 0_u32,
30644 flags: VideoStreamStatusFlags::DEFAULT,
30645 resolution_h: 0_u16,
30646 resolution_v: 0_u16,
30647 rotation: 0_u16,
30648 hfov: 0_u16,
30649 stream_id: 0_u8,
30650 camera_device_id: 0_u8,
30651 };
30652 #[cfg(feature = "arbitrary")]
30653 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30654 use arbitrary::{Arbitrary, Unstructured};
30655 let mut buf = [0u8; 1024];
30656 rng.fill_bytes(&mut buf);
30657 let mut unstructured = Unstructured::new(&buf);
30658 Self::arbitrary(&mut unstructured).unwrap_or_default()
30659 }
30660}
30661impl Default for VIDEO_STREAM_STATUS_DATA {
30662 fn default() -> Self {
30663 Self::DEFAULT.clone()
30664 }
30665}
30666impl MessageData for VIDEO_STREAM_STATUS_DATA {
30667 type Message = MavMessage;
30668 const ID: u32 = 270u32;
30669 const NAME: &'static str = "VIDEO_STREAM_STATUS";
30670 const EXTRA_CRC: u8 = 59u8;
30671 const ENCODED_LEN: usize = 20usize;
30672 fn deser(
30673 _version: MavlinkVersion,
30674 __input: &[u8],
30675 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30676 let avail_len = __input.len();
30677 let mut payload_buf = [0; Self::ENCODED_LEN];
30678 let mut buf = if avail_len < Self::ENCODED_LEN {
30679 payload_buf[0..avail_len].copy_from_slice(__input);
30680 Bytes::new(&payload_buf)
30681 } else {
30682 Bytes::new(__input)
30683 };
30684 let mut __struct = Self::default();
30685 __struct.framerate = buf.get_f32_le();
30686 __struct.bitrate = buf.get_u32_le();
30687 let tmp = buf.get_u16_le();
30688 __struct.flags = VideoStreamStatusFlags::from_bits(
30689 tmp & VideoStreamStatusFlags::all().bits(),
30690 )
30691 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
30692 flag_type: "VideoStreamStatusFlags",
30693 value: tmp as u32,
30694 })?;
30695 __struct.resolution_h = buf.get_u16_le();
30696 __struct.resolution_v = buf.get_u16_le();
30697 __struct.rotation = buf.get_u16_le();
30698 __struct.hfov = buf.get_u16_le();
30699 __struct.stream_id = buf.get_u8();
30700 __struct.camera_device_id = buf.get_u8();
30701 Ok(__struct)
30702 }
30703 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30704 let mut __tmp = BytesMut::new(bytes);
30705 #[allow(clippy::absurd_extreme_comparisons)]
30706 #[allow(unused_comparisons)]
30707 if __tmp.remaining() < Self::ENCODED_LEN {
30708 panic!(
30709 "buffer is too small (need {} bytes, but got {})",
30710 Self::ENCODED_LEN,
30711 __tmp.remaining(),
30712 )
30713 }
30714 __tmp.put_f32_le(self.framerate);
30715 __tmp.put_u32_le(self.bitrate);
30716 __tmp.put_u16_le(self.flags.bits());
30717 __tmp.put_u16_le(self.resolution_h);
30718 __tmp.put_u16_le(self.resolution_v);
30719 __tmp.put_u16_le(self.rotation);
30720 __tmp.put_u16_le(self.hfov);
30721 __tmp.put_u8(self.stream_id);
30722 __tmp.put_u8(self.camera_device_id);
30723 if matches!(version, MavlinkVersion::V2) {
30724 let len = __tmp.len();
30725 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30726 } else {
30727 __tmp.len()
30728 }
30729 }
30730}
30731#[doc = "id: 102"]
30732#[doc = "Local position/attitude estimate from a vision source."]
30733#[derive(Debug, Clone, PartialEq)]
30734#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30735#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30736pub struct VISION_POSITION_ESTIMATE_DATA {
30737 #[doc = "Timestamp (UNIX time or time since system boot)"]
30738 pub usec: u64,
30739 #[doc = "Local X position"]
30740 pub x: f32,
30741 #[doc = "Local Y position"]
30742 pub y: f32,
30743 #[doc = "Local Z position"]
30744 pub z: f32,
30745 #[doc = "Roll angle"]
30746 pub roll: f32,
30747 #[doc = "Pitch angle"]
30748 pub pitch: f32,
30749 #[doc = "Yaw angle"]
30750 pub yaw: f32,
30751 #[doc = "Row-major representation of pose 6x6 cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
30752 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
30753 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30754 pub covariance: [f32; 21],
30755 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
30756 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
30757 pub reset_counter: u8,
30758}
30759impl VISION_POSITION_ESTIMATE_DATA {
30760 pub const ENCODED_LEN: usize = 117usize;
30761 pub const DEFAULT: Self = Self {
30762 usec: 0_u64,
30763 x: 0.0_f32,
30764 y: 0.0_f32,
30765 z: 0.0_f32,
30766 roll: 0.0_f32,
30767 pitch: 0.0_f32,
30768 yaw: 0.0_f32,
30769 covariance: [0.0_f32; 21usize],
30770 reset_counter: 0_u8,
30771 };
30772 #[cfg(feature = "arbitrary")]
30773 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30774 use arbitrary::{Arbitrary, Unstructured};
30775 let mut buf = [0u8; 1024];
30776 rng.fill_bytes(&mut buf);
30777 let mut unstructured = Unstructured::new(&buf);
30778 Self::arbitrary(&mut unstructured).unwrap_or_default()
30779 }
30780}
30781impl Default for VISION_POSITION_ESTIMATE_DATA {
30782 fn default() -> Self {
30783 Self::DEFAULT.clone()
30784 }
30785}
30786impl MessageData for VISION_POSITION_ESTIMATE_DATA {
30787 type Message = MavMessage;
30788 const ID: u32 = 102u32;
30789 const NAME: &'static str = "VISION_POSITION_ESTIMATE";
30790 const EXTRA_CRC: u8 = 158u8;
30791 const ENCODED_LEN: usize = 117usize;
30792 fn deser(
30793 _version: MavlinkVersion,
30794 __input: &[u8],
30795 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30796 let avail_len = __input.len();
30797 let mut payload_buf = [0; Self::ENCODED_LEN];
30798 let mut buf = if avail_len < Self::ENCODED_LEN {
30799 payload_buf[0..avail_len].copy_from_slice(__input);
30800 Bytes::new(&payload_buf)
30801 } else {
30802 Bytes::new(__input)
30803 };
30804 let mut __struct = Self::default();
30805 __struct.usec = buf.get_u64_le();
30806 __struct.x = buf.get_f32_le();
30807 __struct.y = buf.get_f32_le();
30808 __struct.z = buf.get_f32_le();
30809 __struct.roll = buf.get_f32_le();
30810 __struct.pitch = buf.get_f32_le();
30811 __struct.yaw = buf.get_f32_le();
30812 for v in &mut __struct.covariance {
30813 let val = buf.get_f32_le();
30814 *v = val;
30815 }
30816 __struct.reset_counter = buf.get_u8();
30817 Ok(__struct)
30818 }
30819 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30820 let mut __tmp = BytesMut::new(bytes);
30821 #[allow(clippy::absurd_extreme_comparisons)]
30822 #[allow(unused_comparisons)]
30823 if __tmp.remaining() < Self::ENCODED_LEN {
30824 panic!(
30825 "buffer is too small (need {} bytes, but got {})",
30826 Self::ENCODED_LEN,
30827 __tmp.remaining(),
30828 )
30829 }
30830 __tmp.put_u64_le(self.usec);
30831 __tmp.put_f32_le(self.x);
30832 __tmp.put_f32_le(self.y);
30833 __tmp.put_f32_le(self.z);
30834 __tmp.put_f32_le(self.roll);
30835 __tmp.put_f32_le(self.pitch);
30836 __tmp.put_f32_le(self.yaw);
30837 for val in &self.covariance {
30838 __tmp.put_f32_le(*val);
30839 }
30840 __tmp.put_u8(self.reset_counter);
30841 if matches!(version, MavlinkVersion::V2) {
30842 let len = __tmp.len();
30843 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30844 } else {
30845 __tmp.len()
30846 }
30847 }
30848}
30849#[doc = "id: 103"]
30850#[doc = "Speed estimate from a vision source."]
30851#[derive(Debug, Clone, PartialEq)]
30852#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30853#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30854pub struct VISION_SPEED_ESTIMATE_DATA {
30855 #[doc = "Timestamp (UNIX time or time since system boot)"]
30856 pub usec: u64,
30857 #[doc = "Global X speed"]
30858 pub x: f32,
30859 #[doc = "Global Y speed"]
30860 pub y: f32,
30861 #[doc = "Global Z speed"]
30862 pub z: f32,
30863 #[doc = "Row-major representation of 3x3 linear velocity covariance matrix (states: vx, vy, vz; 1st three entries - 1st row, etc.). If unknown, assign NaN value to first element in the array."]
30864 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
30865 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30866 pub covariance: [f32; 9],
30867 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
30868 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
30869 pub reset_counter: u8,
30870}
30871impl VISION_SPEED_ESTIMATE_DATA {
30872 pub const ENCODED_LEN: usize = 57usize;
30873 pub const DEFAULT: Self = Self {
30874 usec: 0_u64,
30875 x: 0.0_f32,
30876 y: 0.0_f32,
30877 z: 0.0_f32,
30878 covariance: [0.0_f32; 9usize],
30879 reset_counter: 0_u8,
30880 };
30881 #[cfg(feature = "arbitrary")]
30882 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30883 use arbitrary::{Arbitrary, Unstructured};
30884 let mut buf = [0u8; 1024];
30885 rng.fill_bytes(&mut buf);
30886 let mut unstructured = Unstructured::new(&buf);
30887 Self::arbitrary(&mut unstructured).unwrap_or_default()
30888 }
30889}
30890impl Default for VISION_SPEED_ESTIMATE_DATA {
30891 fn default() -> Self {
30892 Self::DEFAULT.clone()
30893 }
30894}
30895impl MessageData for VISION_SPEED_ESTIMATE_DATA {
30896 type Message = MavMessage;
30897 const ID: u32 = 103u32;
30898 const NAME: &'static str = "VISION_SPEED_ESTIMATE";
30899 const EXTRA_CRC: u8 = 208u8;
30900 const ENCODED_LEN: usize = 57usize;
30901 fn deser(
30902 _version: MavlinkVersion,
30903 __input: &[u8],
30904 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30905 let avail_len = __input.len();
30906 let mut payload_buf = [0; Self::ENCODED_LEN];
30907 let mut buf = if avail_len < Self::ENCODED_LEN {
30908 payload_buf[0..avail_len].copy_from_slice(__input);
30909 Bytes::new(&payload_buf)
30910 } else {
30911 Bytes::new(__input)
30912 };
30913 let mut __struct = Self::default();
30914 __struct.usec = buf.get_u64_le();
30915 __struct.x = buf.get_f32_le();
30916 __struct.y = buf.get_f32_le();
30917 __struct.z = buf.get_f32_le();
30918 for v in &mut __struct.covariance {
30919 let val = buf.get_f32_le();
30920 *v = val;
30921 }
30922 __struct.reset_counter = buf.get_u8();
30923 Ok(__struct)
30924 }
30925 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30926 let mut __tmp = BytesMut::new(bytes);
30927 #[allow(clippy::absurd_extreme_comparisons)]
30928 #[allow(unused_comparisons)]
30929 if __tmp.remaining() < Self::ENCODED_LEN {
30930 panic!(
30931 "buffer is too small (need {} bytes, but got {})",
30932 Self::ENCODED_LEN,
30933 __tmp.remaining(),
30934 )
30935 }
30936 __tmp.put_u64_le(self.usec);
30937 __tmp.put_f32_le(self.x);
30938 __tmp.put_f32_le(self.y);
30939 __tmp.put_f32_le(self.z);
30940 for val in &self.covariance {
30941 __tmp.put_f32_le(*val);
30942 }
30943 __tmp.put_u8(self.reset_counter);
30944 if matches!(version, MavlinkVersion::V2) {
30945 let len = __tmp.len();
30946 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30947 } else {
30948 __tmp.len()
30949 }
30950 }
30951}
30952#[doc = "id: 9000"]
30953#[doc = "Cumulative distance traveled for each reported wheel."]
30954#[derive(Debug, Clone, PartialEq)]
30955#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30956#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30957pub struct WHEEL_DISTANCE_DATA {
30958 #[doc = "Timestamp (synced to UNIX time or since system boot)."]
30959 pub time_usec: u64,
30960 #[doc = "Distance reported by individual wheel encoders. Forward rotations increase values, reverse rotations decrease them. Not all wheels will necessarily have wheel encoders; the mapping of encoders to wheel positions must be agreed/understood by the endpoints."]
30961 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30962 pub distance: [f64; 16],
30963 #[doc = "Number of wheels reported."]
30964 pub count: u8,
30965}
30966impl WHEEL_DISTANCE_DATA {
30967 pub const ENCODED_LEN: usize = 137usize;
30968 pub const DEFAULT: Self = Self {
30969 time_usec: 0_u64,
30970 distance: [0.0_f64; 16usize],
30971 count: 0_u8,
30972 };
30973 #[cfg(feature = "arbitrary")]
30974 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30975 use arbitrary::{Arbitrary, Unstructured};
30976 let mut buf = [0u8; 1024];
30977 rng.fill_bytes(&mut buf);
30978 let mut unstructured = Unstructured::new(&buf);
30979 Self::arbitrary(&mut unstructured).unwrap_or_default()
30980 }
30981}
30982impl Default for WHEEL_DISTANCE_DATA {
30983 fn default() -> Self {
30984 Self::DEFAULT.clone()
30985 }
30986}
30987impl MessageData for WHEEL_DISTANCE_DATA {
30988 type Message = MavMessage;
30989 const ID: u32 = 9000u32;
30990 const NAME: &'static str = "WHEEL_DISTANCE";
30991 const EXTRA_CRC: u8 = 113u8;
30992 const ENCODED_LEN: usize = 137usize;
30993 fn deser(
30994 _version: MavlinkVersion,
30995 __input: &[u8],
30996 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30997 let avail_len = __input.len();
30998 let mut payload_buf = [0; Self::ENCODED_LEN];
30999 let mut buf = if avail_len < Self::ENCODED_LEN {
31000 payload_buf[0..avail_len].copy_from_slice(__input);
31001 Bytes::new(&payload_buf)
31002 } else {
31003 Bytes::new(__input)
31004 };
31005 let mut __struct = Self::default();
31006 __struct.time_usec = buf.get_u64_le();
31007 for v in &mut __struct.distance {
31008 let val = buf.get_f64_le();
31009 *v = val;
31010 }
31011 __struct.count = buf.get_u8();
31012 Ok(__struct)
31013 }
31014 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31015 let mut __tmp = BytesMut::new(bytes);
31016 #[allow(clippy::absurd_extreme_comparisons)]
31017 #[allow(unused_comparisons)]
31018 if __tmp.remaining() < Self::ENCODED_LEN {
31019 panic!(
31020 "buffer is too small (need {} bytes, but got {})",
31021 Self::ENCODED_LEN,
31022 __tmp.remaining(),
31023 )
31024 }
31025 __tmp.put_u64_le(self.time_usec);
31026 for val in &self.distance {
31027 __tmp.put_f64_le(*val);
31028 }
31029 __tmp.put_u8(self.count);
31030 if matches!(version, MavlinkVersion::V2) {
31031 let len = __tmp.len();
31032 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31033 } else {
31034 __tmp.len()
31035 }
31036 }
31037}
31038#[doc = "id: 299"]
31039#[doc = "Configure WiFi AP SSID, password, and mode. This message is re-emitted as an acknowledgement by the AP. The message may also be explicitly requested using MAV_CMD_REQUEST_MESSAGE."]
31040#[derive(Debug, Clone, PartialEq)]
31041#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31042#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31043pub struct WIFI_CONFIG_AP_DATA {
31044 #[doc = "Name of Wi-Fi network (SSID). Blank to leave it unchanged when setting. Current SSID when sent back as a response."]
31045 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31046 pub ssid: [u8; 32],
31047 #[doc = "Password. Blank for an open AP. MD5 hash when message is sent back as a response."]
31048 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31049 pub password: [u8; 64],
31050 #[doc = "WiFi Mode."]
31051 #[cfg_attr(feature = "serde", serde(default))]
31052 pub mode: WifiConfigApMode,
31053 #[doc = "Message acceptance response (sent back to GS)."]
31054 #[cfg_attr(feature = "serde", serde(default))]
31055 pub response: WifiConfigApResponse,
31056}
31057impl WIFI_CONFIG_AP_DATA {
31058 pub const ENCODED_LEN: usize = 98usize;
31059 pub const DEFAULT: Self = Self {
31060 ssid: [0_u8; 32usize],
31061 password: [0_u8; 64usize],
31062 mode: WifiConfigApMode::DEFAULT,
31063 response: WifiConfigApResponse::DEFAULT,
31064 };
31065 #[cfg(feature = "arbitrary")]
31066 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31067 use arbitrary::{Arbitrary, Unstructured};
31068 let mut buf = [0u8; 1024];
31069 rng.fill_bytes(&mut buf);
31070 let mut unstructured = Unstructured::new(&buf);
31071 Self::arbitrary(&mut unstructured).unwrap_or_default()
31072 }
31073}
31074impl Default for WIFI_CONFIG_AP_DATA {
31075 fn default() -> Self {
31076 Self::DEFAULT.clone()
31077 }
31078}
31079impl MessageData for WIFI_CONFIG_AP_DATA {
31080 type Message = MavMessage;
31081 const ID: u32 = 299u32;
31082 const NAME: &'static str = "WIFI_CONFIG_AP";
31083 const EXTRA_CRC: u8 = 19u8;
31084 const ENCODED_LEN: usize = 98usize;
31085 fn deser(
31086 _version: MavlinkVersion,
31087 __input: &[u8],
31088 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31089 let avail_len = __input.len();
31090 let mut payload_buf = [0; Self::ENCODED_LEN];
31091 let mut buf = if avail_len < Self::ENCODED_LEN {
31092 payload_buf[0..avail_len].copy_from_slice(__input);
31093 Bytes::new(&payload_buf)
31094 } else {
31095 Bytes::new(__input)
31096 };
31097 let mut __struct = Self::default();
31098 for v in &mut __struct.ssid {
31099 let val = buf.get_u8();
31100 *v = val;
31101 }
31102 for v in &mut __struct.password {
31103 let val = buf.get_u8();
31104 *v = val;
31105 }
31106 let tmp = buf.get_i8();
31107 __struct.mode =
31108 FromPrimitive::from_i8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
31109 enum_type: "WifiConfigApMode",
31110 value: tmp as u32,
31111 })?;
31112 let tmp = buf.get_i8();
31113 __struct.response =
31114 FromPrimitive::from_i8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
31115 enum_type: "WifiConfigApResponse",
31116 value: tmp as u32,
31117 })?;
31118 Ok(__struct)
31119 }
31120 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31121 let mut __tmp = BytesMut::new(bytes);
31122 #[allow(clippy::absurd_extreme_comparisons)]
31123 #[allow(unused_comparisons)]
31124 if __tmp.remaining() < Self::ENCODED_LEN {
31125 panic!(
31126 "buffer is too small (need {} bytes, but got {})",
31127 Self::ENCODED_LEN,
31128 __tmp.remaining(),
31129 )
31130 }
31131 for val in &self.ssid {
31132 __tmp.put_u8(*val);
31133 }
31134 for val in &self.password {
31135 __tmp.put_u8(*val);
31136 }
31137 __tmp.put_i8(self.mode as i8);
31138 __tmp.put_i8(self.response as i8);
31139 if matches!(version, MavlinkVersion::V2) {
31140 let len = __tmp.len();
31141 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31142 } else {
31143 __tmp.len()
31144 }
31145 }
31146}
31147#[doc = "id: 9005"]
31148#[doc = "Winch status."]
31149#[derive(Debug, Clone, PartialEq)]
31150#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31151#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31152pub struct WINCH_STATUS_DATA {
31153 #[doc = "Timestamp (synced to UNIX time or since system boot)."]
31154 pub time_usec: u64,
31155 #[doc = "Length of line released. NaN if unknown"]
31156 pub line_length: f32,
31157 #[doc = "Speed line is being released or retracted. Positive values if being released, negative values if being retracted, NaN if unknown"]
31158 pub speed: f32,
31159 #[doc = "Tension on the line. NaN if unknown"]
31160 pub tension: f32,
31161 #[doc = "Voltage of the battery supplying the winch. NaN if unknown"]
31162 pub voltage: f32,
31163 #[doc = "Current draw from the winch. NaN if unknown"]
31164 pub current: f32,
31165 #[doc = "Status flags"]
31166 pub status: MavWinchStatusFlag,
31167 #[doc = "Temperature of the motor. INT16_MAX if unknown"]
31168 pub temperature: i16,
31169}
31170impl WINCH_STATUS_DATA {
31171 pub const ENCODED_LEN: usize = 34usize;
31172 pub const DEFAULT: Self = Self {
31173 time_usec: 0_u64,
31174 line_length: 0.0_f32,
31175 speed: 0.0_f32,
31176 tension: 0.0_f32,
31177 voltage: 0.0_f32,
31178 current: 0.0_f32,
31179 status: MavWinchStatusFlag::DEFAULT,
31180 temperature: 0_i16,
31181 };
31182 #[cfg(feature = "arbitrary")]
31183 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31184 use arbitrary::{Arbitrary, Unstructured};
31185 let mut buf = [0u8; 1024];
31186 rng.fill_bytes(&mut buf);
31187 let mut unstructured = Unstructured::new(&buf);
31188 Self::arbitrary(&mut unstructured).unwrap_or_default()
31189 }
31190}
31191impl Default for WINCH_STATUS_DATA {
31192 fn default() -> Self {
31193 Self::DEFAULT.clone()
31194 }
31195}
31196impl MessageData for WINCH_STATUS_DATA {
31197 type Message = MavMessage;
31198 const ID: u32 = 9005u32;
31199 const NAME: &'static str = "WINCH_STATUS";
31200 const EXTRA_CRC: u8 = 117u8;
31201 const ENCODED_LEN: usize = 34usize;
31202 fn deser(
31203 _version: MavlinkVersion,
31204 __input: &[u8],
31205 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31206 let avail_len = __input.len();
31207 let mut payload_buf = [0; Self::ENCODED_LEN];
31208 let mut buf = if avail_len < Self::ENCODED_LEN {
31209 payload_buf[0..avail_len].copy_from_slice(__input);
31210 Bytes::new(&payload_buf)
31211 } else {
31212 Bytes::new(__input)
31213 };
31214 let mut __struct = Self::default();
31215 __struct.time_usec = buf.get_u64_le();
31216 __struct.line_length = buf.get_f32_le();
31217 __struct.speed = buf.get_f32_le();
31218 __struct.tension = buf.get_f32_le();
31219 __struct.voltage = buf.get_f32_le();
31220 __struct.current = buf.get_f32_le();
31221 let tmp = buf.get_u32_le();
31222 __struct.status = MavWinchStatusFlag::from_bits(tmp & MavWinchStatusFlag::all().bits())
31223 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
31224 flag_type: "MavWinchStatusFlag",
31225 value: tmp as u32,
31226 })?;
31227 __struct.temperature = buf.get_i16_le();
31228 Ok(__struct)
31229 }
31230 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31231 let mut __tmp = BytesMut::new(bytes);
31232 #[allow(clippy::absurd_extreme_comparisons)]
31233 #[allow(unused_comparisons)]
31234 if __tmp.remaining() < Self::ENCODED_LEN {
31235 panic!(
31236 "buffer is too small (need {} bytes, but got {})",
31237 Self::ENCODED_LEN,
31238 __tmp.remaining(),
31239 )
31240 }
31241 __tmp.put_u64_le(self.time_usec);
31242 __tmp.put_f32_le(self.line_length);
31243 __tmp.put_f32_le(self.speed);
31244 __tmp.put_f32_le(self.tension);
31245 __tmp.put_f32_le(self.voltage);
31246 __tmp.put_f32_le(self.current);
31247 __tmp.put_u32_le(self.status.bits());
31248 __tmp.put_i16_le(self.temperature);
31249 if matches!(version, MavlinkVersion::V2) {
31250 let len = __tmp.len();
31251 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31252 } else {
31253 __tmp.len()
31254 }
31255 }
31256}
31257#[doc = "id: 231"]
31258#[doc = "Wind estimate from vehicle. Note that despite the name, this message does not actually contain any covariances but instead variability and accuracy fields in terms of standard deviation (1-STD)."]
31259#[derive(Debug, Clone, PartialEq)]
31260#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31261#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31262pub struct WIND_COV_DATA {
31263 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
31264 pub time_usec: u64,
31265 #[doc = "Wind in North (NED) direction (NAN if unknown)"]
31266 pub wind_x: f32,
31267 #[doc = "Wind in East (NED) direction (NAN if unknown)"]
31268 pub wind_y: f32,
31269 #[doc = "Wind in down (NED) direction (NAN if unknown)"]
31270 pub wind_z: f32,
31271 #[doc = "Variability of wind in XY, 1-STD estimated from a 1 Hz lowpassed wind estimate (NAN if unknown)"]
31272 pub var_horiz: f32,
31273 #[doc = "Variability of wind in Z, 1-STD estimated from a 1 Hz lowpassed wind estimate (NAN if unknown)"]
31274 pub var_vert: f32,
31275 #[doc = "Altitude (MSL) that this measurement was taken at (NAN if unknown)"]
31276 pub wind_alt: f32,
31277 #[doc = "Horizontal speed 1-STD accuracy (0 if unknown)"]
31278 pub horiz_accuracy: f32,
31279 #[doc = "Vertical speed 1-STD accuracy (0 if unknown)"]
31280 pub vert_accuracy: f32,
31281}
31282impl WIND_COV_DATA {
31283 pub const ENCODED_LEN: usize = 40usize;
31284 pub const DEFAULT: Self = Self {
31285 time_usec: 0_u64,
31286 wind_x: 0.0_f32,
31287 wind_y: 0.0_f32,
31288 wind_z: 0.0_f32,
31289 var_horiz: 0.0_f32,
31290 var_vert: 0.0_f32,
31291 wind_alt: 0.0_f32,
31292 horiz_accuracy: 0.0_f32,
31293 vert_accuracy: 0.0_f32,
31294 };
31295 #[cfg(feature = "arbitrary")]
31296 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31297 use arbitrary::{Arbitrary, Unstructured};
31298 let mut buf = [0u8; 1024];
31299 rng.fill_bytes(&mut buf);
31300 let mut unstructured = Unstructured::new(&buf);
31301 Self::arbitrary(&mut unstructured).unwrap_or_default()
31302 }
31303}
31304impl Default for WIND_COV_DATA {
31305 fn default() -> Self {
31306 Self::DEFAULT.clone()
31307 }
31308}
31309impl MessageData for WIND_COV_DATA {
31310 type Message = MavMessage;
31311 const ID: u32 = 231u32;
31312 const NAME: &'static str = "WIND_COV";
31313 const EXTRA_CRC: u8 = 105u8;
31314 const ENCODED_LEN: usize = 40usize;
31315 fn deser(
31316 _version: MavlinkVersion,
31317 __input: &[u8],
31318 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31319 let avail_len = __input.len();
31320 let mut payload_buf = [0; Self::ENCODED_LEN];
31321 let mut buf = if avail_len < Self::ENCODED_LEN {
31322 payload_buf[0..avail_len].copy_from_slice(__input);
31323 Bytes::new(&payload_buf)
31324 } else {
31325 Bytes::new(__input)
31326 };
31327 let mut __struct = Self::default();
31328 __struct.time_usec = buf.get_u64_le();
31329 __struct.wind_x = buf.get_f32_le();
31330 __struct.wind_y = buf.get_f32_le();
31331 __struct.wind_z = buf.get_f32_le();
31332 __struct.var_horiz = buf.get_f32_le();
31333 __struct.var_vert = buf.get_f32_le();
31334 __struct.wind_alt = buf.get_f32_le();
31335 __struct.horiz_accuracy = buf.get_f32_le();
31336 __struct.vert_accuracy = buf.get_f32_le();
31337 Ok(__struct)
31338 }
31339 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31340 let mut __tmp = BytesMut::new(bytes);
31341 #[allow(clippy::absurd_extreme_comparisons)]
31342 #[allow(unused_comparisons)]
31343 if __tmp.remaining() < Self::ENCODED_LEN {
31344 panic!(
31345 "buffer is too small (need {} bytes, but got {})",
31346 Self::ENCODED_LEN,
31347 __tmp.remaining(),
31348 )
31349 }
31350 __tmp.put_u64_le(self.time_usec);
31351 __tmp.put_f32_le(self.wind_x);
31352 __tmp.put_f32_le(self.wind_y);
31353 __tmp.put_f32_le(self.wind_z);
31354 __tmp.put_f32_le(self.var_horiz);
31355 __tmp.put_f32_le(self.var_vert);
31356 __tmp.put_f32_le(self.wind_alt);
31357 __tmp.put_f32_le(self.horiz_accuracy);
31358 __tmp.put_f32_le(self.vert_accuracy);
31359 if matches!(version, MavlinkVersion::V2) {
31360 let len = __tmp.len();
31361 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31362 } else {
31363 __tmp.len()
31364 }
31365 }
31366}
31367#[derive(Clone, PartialEq, Debug)]
31368#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31369#[cfg_attr(feature = "serde", serde(tag = "type"))]
31370#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31371#[repr(u32)]
31372pub enum MavMessage {
31373 ACTUATOR_CONTROL_TARGET(ACTUATOR_CONTROL_TARGET_DATA),
31374 ACTUATOR_OUTPUT_STATUS(ACTUATOR_OUTPUT_STATUS_DATA),
31375 ADSB_VEHICLE(ADSB_VEHICLE_DATA),
31376 AIS_VESSEL(AIS_VESSEL_DATA),
31377 ALTITUDE(ALTITUDE_DATA),
31378 ATTITUDE(ATTITUDE_DATA),
31379 ATTITUDE_QUATERNION(ATTITUDE_QUATERNION_DATA),
31380 ATTITUDE_QUATERNION_COV(ATTITUDE_QUATERNION_COV_DATA),
31381 ATTITUDE_TARGET(ATTITUDE_TARGET_DATA),
31382 ATT_POS_MOCAP(ATT_POS_MOCAP_DATA),
31383 AUTH_KEY(AUTH_KEY_DATA),
31384 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA),
31385 AUTOPILOT_VERSION(AUTOPILOT_VERSION_DATA),
31386 AVAILABLE_MODES(AVAILABLE_MODES_DATA),
31387 AVAILABLE_MODES_MONITOR(AVAILABLE_MODES_MONITOR_DATA),
31388 BATTERY_INFO(BATTERY_INFO_DATA),
31389 BATTERY_STATUS(BATTERY_STATUS_DATA),
31390 BUTTON_CHANGE(BUTTON_CHANGE_DATA),
31391 CAMERA_CAPTURE_STATUS(CAMERA_CAPTURE_STATUS_DATA),
31392 CAMERA_FOV_STATUS(CAMERA_FOV_STATUS_DATA),
31393 CAMERA_IMAGE_CAPTURED(CAMERA_IMAGE_CAPTURED_DATA),
31394 CAMERA_INFORMATION(CAMERA_INFORMATION_DATA),
31395 CAMERA_SETTINGS(CAMERA_SETTINGS_DATA),
31396 CAMERA_THERMAL_RANGE(CAMERA_THERMAL_RANGE_DATA),
31397 CAMERA_TRACKING_GEO_STATUS(CAMERA_TRACKING_GEO_STATUS_DATA),
31398 CAMERA_TRACKING_IMAGE_STATUS(CAMERA_TRACKING_IMAGE_STATUS_DATA),
31399 CAMERA_TRIGGER(CAMERA_TRIGGER_DATA),
31400 CANFD_FRAME(CANFD_FRAME_DATA),
31401 CAN_FILTER_MODIFY(CAN_FILTER_MODIFY_DATA),
31402 CAN_FRAME(CAN_FRAME_DATA),
31403 CELLULAR_CONFIG(CELLULAR_CONFIG_DATA),
31404 CELLULAR_STATUS(CELLULAR_STATUS_DATA),
31405 CHANGE_OPERATOR_CONTROL(CHANGE_OPERATOR_CONTROL_DATA),
31406 CHANGE_OPERATOR_CONTROL_ACK(CHANGE_OPERATOR_CONTROL_ACK_DATA),
31407 COLLISION(COLLISION_DATA),
31408 COMMAND_ACK(COMMAND_ACK_DATA),
31409 COMMAND_CANCEL(COMMAND_CANCEL_DATA),
31410 COMMAND_INT(COMMAND_INT_DATA),
31411 COMMAND_LONG(COMMAND_LONG_DATA),
31412 #[deprecated = " See `COMPONENT_METADATA` (Deprecated since 2022-04)"]
31413 COMPONENT_INFORMATION(COMPONENT_INFORMATION_DATA),
31414 COMPONENT_INFORMATION_BASIC(COMPONENT_INFORMATION_BASIC_DATA),
31415 COMPONENT_METADATA(COMPONENT_METADATA_DATA),
31416 CONTROL_SYSTEM_STATE(CONTROL_SYSTEM_STATE_DATA),
31417 CURRENT_EVENT_SEQUENCE(CURRENT_EVENT_SEQUENCE_DATA),
31418 CURRENT_MODE(CURRENT_MODE_DATA),
31419 #[deprecated = " See `MESSAGE_INTERVAL` (Deprecated since 2015-08)"]
31420 DATA_STREAM(DATA_STREAM_DATA),
31421 DATA_TRANSMISSION_HANDSHAKE(DATA_TRANSMISSION_HANDSHAKE_DATA),
31422 DEBUG(DEBUG_DATA),
31423 DEBUG_FLOAT_ARRAY(DEBUG_FLOAT_ARRAY_DATA),
31424 DEBUG_VECT(DEBUG_VECT_DATA),
31425 DISTANCE_SENSOR(DISTANCE_SENSOR_DATA),
31426 EFI_STATUS(EFI_STATUS_DATA),
31427 ENCAPSULATED_DATA(ENCAPSULATED_DATA_DATA),
31428 ESC_INFO(ESC_INFO_DATA),
31429 ESC_STATUS(ESC_STATUS_DATA),
31430 ESTIMATOR_STATUS(ESTIMATOR_STATUS_DATA),
31431 EVENT(EVENT_DATA),
31432 EXTENDED_SYS_STATE(EXTENDED_SYS_STATE_DATA),
31433 FENCE_STATUS(FENCE_STATUS_DATA),
31434 FILE_TRANSFER_PROTOCOL(FILE_TRANSFER_PROTOCOL_DATA),
31435 FLIGHT_INFORMATION(FLIGHT_INFORMATION_DATA),
31436 FOLLOW_TARGET(FOLLOW_TARGET_DATA),
31437 FUEL_STATUS(FUEL_STATUS_DATA),
31438 GENERATOR_STATUS(GENERATOR_STATUS_DATA),
31439 GIMBAL_DEVICE_ATTITUDE_STATUS(GIMBAL_DEVICE_ATTITUDE_STATUS_DATA),
31440 GIMBAL_DEVICE_INFORMATION(GIMBAL_DEVICE_INFORMATION_DATA),
31441 GIMBAL_DEVICE_SET_ATTITUDE(GIMBAL_DEVICE_SET_ATTITUDE_DATA),
31442 GIMBAL_MANAGER_INFORMATION(GIMBAL_MANAGER_INFORMATION_DATA),
31443 GIMBAL_MANAGER_SET_ATTITUDE(GIMBAL_MANAGER_SET_ATTITUDE_DATA),
31444 GIMBAL_MANAGER_SET_MANUAL_CONTROL(GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA),
31445 GIMBAL_MANAGER_SET_PITCHYAW(GIMBAL_MANAGER_SET_PITCHYAW_DATA),
31446 GIMBAL_MANAGER_STATUS(GIMBAL_MANAGER_STATUS_DATA),
31447 GLOBAL_POSITION_INT(GLOBAL_POSITION_INT_DATA),
31448 GLOBAL_POSITION_INT_COV(GLOBAL_POSITION_INT_COV_DATA),
31449 GLOBAL_VISION_POSITION_ESTIMATE(GLOBAL_VISION_POSITION_ESTIMATE_DATA),
31450 GPS2_RAW(GPS2_RAW_DATA),
31451 GPS2_RTK(GPS2_RTK_DATA),
31452 GPS_GLOBAL_ORIGIN(GPS_GLOBAL_ORIGIN_DATA),
31453 #[deprecated = " See `GPS_RTCM_DATA` (Deprecated since 2022-05)"]
31454 GPS_INJECT_DATA(GPS_INJECT_DATA_DATA),
31455 GPS_INPUT(GPS_INPUT_DATA),
31456 GPS_RAW_INT(GPS_RAW_INT_DATA),
31457 GPS_RTCM_DATA(GPS_RTCM_DATA_DATA),
31458 GPS_RTK(GPS_RTK_DATA),
31459 GPS_STATUS(GPS_STATUS_DATA),
31460 HEARTBEAT(HEARTBEAT_DATA),
31461 HIGHRES_IMU(HIGHRES_IMU_DATA),
31462 #[deprecated = " See `HIGH_LATENCY2` (Deprecated since 2020-10)"]
31463 HIGH_LATENCY(HIGH_LATENCY_DATA),
31464 HIGH_LATENCY2(HIGH_LATENCY2_DATA),
31465 HIL_ACTUATOR_CONTROLS(HIL_ACTUATOR_CONTROLS_DATA),
31466 HIL_CONTROLS(HIL_CONTROLS_DATA),
31467 HIL_GPS(HIL_GPS_DATA),
31468 HIL_OPTICAL_FLOW(HIL_OPTICAL_FLOW_DATA),
31469 HIL_RC_INPUTS_RAW(HIL_RC_INPUTS_RAW_DATA),
31470 HIL_SENSOR(HIL_SENSOR_DATA),
31471 #[deprecated = "Suffers from missing airspeed fields and singularities due to Euler angles. See `HIL_STATE_QUATERNION` (Deprecated since 2013-07)"]
31472 HIL_STATE(HIL_STATE_DATA),
31473 HIL_STATE_QUATERNION(HIL_STATE_QUATERNION_DATA),
31474 HOME_POSITION(HOME_POSITION_DATA),
31475 HYGROMETER_SENSOR(HYGROMETER_SENSOR_DATA),
31476 ILLUMINATOR_STATUS(ILLUMINATOR_STATUS_DATA),
31477 ISBD_LINK_STATUS(ISBD_LINK_STATUS_DATA),
31478 LANDING_TARGET(LANDING_TARGET_DATA),
31479 LINK_NODE_STATUS(LINK_NODE_STATUS_DATA),
31480 LOCAL_POSITION_NED(LOCAL_POSITION_NED_DATA),
31481 LOCAL_POSITION_NED_COV(LOCAL_POSITION_NED_COV_DATA),
31482 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA),
31483 LOGGING_ACK(LOGGING_ACK_DATA),
31484 LOGGING_DATA(LOGGING_DATA_DATA),
31485 LOGGING_DATA_ACKED(LOGGING_DATA_ACKED_DATA),
31486 LOG_DATA(LOG_DATA_DATA),
31487 LOG_ENTRY(LOG_ENTRY_DATA),
31488 LOG_ERASE(LOG_ERASE_DATA),
31489 LOG_REQUEST_DATA(LOG_REQUEST_DATA_DATA),
31490 LOG_REQUEST_END(LOG_REQUEST_END_DATA),
31491 LOG_REQUEST_LIST(LOG_REQUEST_LIST_DATA),
31492 MAG_CAL_REPORT(MAG_CAL_REPORT_DATA),
31493 MANUAL_CONTROL(MANUAL_CONTROL_DATA),
31494 MANUAL_SETPOINT(MANUAL_SETPOINT_DATA),
31495 MEMORY_VECT(MEMORY_VECT_DATA),
31496 MESSAGE_INTERVAL(MESSAGE_INTERVAL_DATA),
31497 MISSION_ACK(MISSION_ACK_DATA),
31498 MISSION_CLEAR_ALL(MISSION_CLEAR_ALL_DATA),
31499 MISSION_COUNT(MISSION_COUNT_DATA),
31500 MISSION_CURRENT(MISSION_CURRENT_DATA),
31501 #[deprecated = " See `MISSION_ITEM_INT` (Deprecated since 2020-06)"]
31502 MISSION_ITEM(MISSION_ITEM_DATA),
31503 MISSION_ITEM_INT(MISSION_ITEM_INT_DATA),
31504 MISSION_ITEM_REACHED(MISSION_ITEM_REACHED_DATA),
31505 #[deprecated = "A system that gets this request should respond with MISSION_ITEM_INT (as though MISSION_REQUEST_INT was received). See `MISSION_REQUEST_INT` (Deprecated since 2020-06)"]
31506 MISSION_REQUEST(MISSION_REQUEST_DATA),
31507 MISSION_REQUEST_INT(MISSION_REQUEST_INT_DATA),
31508 MISSION_REQUEST_LIST(MISSION_REQUEST_LIST_DATA),
31509 MISSION_REQUEST_PARTIAL_LIST(MISSION_REQUEST_PARTIAL_LIST_DATA),
31510 #[deprecated = " See `MAV_CMD_DO_SET_MISSION_CURRENT` (Deprecated since 2022-08)"]
31511 MISSION_SET_CURRENT(MISSION_SET_CURRENT_DATA),
31512 MISSION_WRITE_PARTIAL_LIST(MISSION_WRITE_PARTIAL_LIST_DATA),
31513 #[deprecated = "This message is being superseded by MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
31514 MOUNT_ORIENTATION(MOUNT_ORIENTATION_DATA),
31515 NAMED_VALUE_FLOAT(NAMED_VALUE_FLOAT_DATA),
31516 NAMED_VALUE_INT(NAMED_VALUE_INT_DATA),
31517 NAV_CONTROLLER_OUTPUT(NAV_CONTROLLER_OUTPUT_DATA),
31518 OBSTACLE_DISTANCE(OBSTACLE_DISTANCE_DATA),
31519 ODOMETRY(ODOMETRY_DATA),
31520 ONBOARD_COMPUTER_STATUS(ONBOARD_COMPUTER_STATUS_DATA),
31521 OPEN_DRONE_ID_ARM_STATUS(OPEN_DRONE_ID_ARM_STATUS_DATA),
31522 OPEN_DRONE_ID_AUTHENTICATION(OPEN_DRONE_ID_AUTHENTICATION_DATA),
31523 OPEN_DRONE_ID_BASIC_ID(OPEN_DRONE_ID_BASIC_ID_DATA),
31524 OPEN_DRONE_ID_LOCATION(OPEN_DRONE_ID_LOCATION_DATA),
31525 OPEN_DRONE_ID_MESSAGE_PACK(OPEN_DRONE_ID_MESSAGE_PACK_DATA),
31526 OPEN_DRONE_ID_OPERATOR_ID(OPEN_DRONE_ID_OPERATOR_ID_DATA),
31527 OPEN_DRONE_ID_SELF_ID(OPEN_DRONE_ID_SELF_ID_DATA),
31528 OPEN_DRONE_ID_SYSTEM(OPEN_DRONE_ID_SYSTEM_DATA),
31529 OPEN_DRONE_ID_SYSTEM_UPDATE(OPEN_DRONE_ID_SYSTEM_UPDATE_DATA),
31530 OPTICAL_FLOW(OPTICAL_FLOW_DATA),
31531 OPTICAL_FLOW_RAD(OPTICAL_FLOW_RAD_DATA),
31532 ORBIT_EXECUTION_STATUS(ORBIT_EXECUTION_STATUS_DATA),
31533 PARAM_EXT_ACK(PARAM_EXT_ACK_DATA),
31534 PARAM_EXT_REQUEST_LIST(PARAM_EXT_REQUEST_LIST_DATA),
31535 PARAM_EXT_REQUEST_READ(PARAM_EXT_REQUEST_READ_DATA),
31536 PARAM_EXT_SET(PARAM_EXT_SET_DATA),
31537 PARAM_EXT_VALUE(PARAM_EXT_VALUE_DATA),
31538 PARAM_MAP_RC(PARAM_MAP_RC_DATA),
31539 PARAM_REQUEST_LIST(PARAM_REQUEST_LIST_DATA),
31540 PARAM_REQUEST_READ(PARAM_REQUEST_READ_DATA),
31541 PARAM_SET(PARAM_SET_DATA),
31542 PARAM_VALUE(PARAM_VALUE_DATA),
31543 #[deprecated = "To be removed / merged with TIMESYNC. See `TIMESYNC` (Deprecated since 2011-08)"]
31544 PING(PING_DATA),
31545 #[deprecated = "New version explicitly defines format. More interoperable. See `PLAY_TUNE_V2` (Deprecated since 2019-10)"]
31546 PLAY_TUNE(PLAY_TUNE_DATA),
31547 PLAY_TUNE_V2(PLAY_TUNE_V2_DATA),
31548 POSITION_TARGET_GLOBAL_INT(POSITION_TARGET_GLOBAL_INT_DATA),
31549 POSITION_TARGET_LOCAL_NED(POSITION_TARGET_LOCAL_NED_DATA),
31550 POWER_STATUS(POWER_STATUS_DATA),
31551 PROTOCOL_VERSION(PROTOCOL_VERSION_DATA),
31552 RADIO_STATUS(RADIO_STATUS_DATA),
31553 RAW_IMU(RAW_IMU_DATA),
31554 RAW_PRESSURE(RAW_PRESSURE_DATA),
31555 RAW_RPM(RAW_RPM_DATA),
31556 RC_CHANNELS(RC_CHANNELS_DATA),
31557 RC_CHANNELS_OVERRIDE(RC_CHANNELS_OVERRIDE_DATA),
31558 RC_CHANNELS_RAW(RC_CHANNELS_RAW_DATA),
31559 RC_CHANNELS_SCALED(RC_CHANNELS_SCALED_DATA),
31560 #[deprecated = " See `MAV_CMD_SET_MESSAGE_INTERVAL ` (Deprecated since 2015-08)"]
31561 REQUEST_DATA_STREAM(REQUEST_DATA_STREAM_DATA),
31562 REQUEST_EVENT(REQUEST_EVENT_DATA),
31563 RESOURCE_REQUEST(RESOURCE_REQUEST_DATA),
31564 RESPONSE_EVENT_ERROR(RESPONSE_EVENT_ERROR_DATA),
31565 SAFETY_ALLOWED_AREA(SAFETY_ALLOWED_AREA_DATA),
31566 SAFETY_SET_ALLOWED_AREA(SAFETY_SET_ALLOWED_AREA_DATA),
31567 SCALED_IMU(SCALED_IMU_DATA),
31568 SCALED_IMU2(SCALED_IMU2_DATA),
31569 SCALED_IMU3(SCALED_IMU3_DATA),
31570 SCALED_PRESSURE(SCALED_PRESSURE_DATA),
31571 SCALED_PRESSURE2(SCALED_PRESSURE2_DATA),
31572 SCALED_PRESSURE3(SCALED_PRESSURE3_DATA),
31573 SCRIPT_COUNT(SCRIPT_COUNT_DATA),
31574 SCRIPT_CURRENT(SCRIPT_CURRENT_DATA),
31575 SCRIPT_ITEM(SCRIPT_ITEM_DATA),
31576 SCRIPT_REQUEST(SCRIPT_REQUEST_DATA),
31577 SCRIPT_REQUEST_LIST(SCRIPT_REQUEST_LIST_DATA),
31578 SERIAL_CONTROL(SERIAL_CONTROL_DATA),
31579 SERVO_OUTPUT_RAW(SERVO_OUTPUT_RAW_DATA),
31580 SETUP_SIGNING(SETUP_SIGNING_DATA),
31581 SET_ACTUATOR_CONTROL_TARGET(SET_ACTUATOR_CONTROL_TARGET_DATA),
31582 SET_ATTITUDE_TARGET(SET_ATTITUDE_TARGET_DATA),
31583 #[deprecated = " See `MAV_CMD_SET_GLOBAL_ORIGIN` (Deprecated since 2025-04)"]
31584 SET_GPS_GLOBAL_ORIGIN(SET_GPS_GLOBAL_ORIGIN_DATA),
31585 #[deprecated = "The command protocol version (MAV_CMD_DO_SET_HOME) allows a GCS to detect when setting the home position has failed. See `MAV_CMD_DO_SET_HOME` (Deprecated since 2022-02)"]
31586 SET_HOME_POSITION(SET_HOME_POSITION_DATA),
31587 #[deprecated = "Use COMMAND_LONG with MAV_CMD_DO_SET_MODE instead. See `MAV_CMD_DO_SET_MODE` (Deprecated since 2015-12)"]
31588 SET_MODE(SET_MODE_DATA),
31589 SET_POSITION_TARGET_GLOBAL_INT(SET_POSITION_TARGET_GLOBAL_INT_DATA),
31590 SET_POSITION_TARGET_LOCAL_NED(SET_POSITION_TARGET_LOCAL_NED_DATA),
31591 SIM_STATE(SIM_STATE_DATA),
31592 #[deprecated = "The BATTERY_INFO message is better aligned with UAVCAN messages, and in any case is useful even if a battery is not \"smart\". See `BATTERY_INFO` (Deprecated since 2024-02)"]
31593 SMART_BATTERY_INFO(SMART_BATTERY_INFO_DATA),
31594 STATUSTEXT(STATUSTEXT_DATA),
31595 STORAGE_INFORMATION(STORAGE_INFORMATION_DATA),
31596 SUPPORTED_TUNES(SUPPORTED_TUNES_DATA),
31597 SYSTEM_TIME(SYSTEM_TIME_DATA),
31598 SYS_STATUS(SYS_STATUS_DATA),
31599 TERRAIN_CHECK(TERRAIN_CHECK_DATA),
31600 TERRAIN_DATA(TERRAIN_DATA_DATA),
31601 TERRAIN_REPORT(TERRAIN_REPORT_DATA),
31602 TERRAIN_REQUEST(TERRAIN_REQUEST_DATA),
31603 TIMESYNC(TIMESYNC_DATA),
31604 TIME_ESTIMATE_TO_TARGET(TIME_ESTIMATE_TO_TARGET_DATA),
31605 TRAJECTORY_REPRESENTATION_BEZIER(TRAJECTORY_REPRESENTATION_BEZIER_DATA),
31606 TRAJECTORY_REPRESENTATION_WAYPOINTS(TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA),
31607 TUNNEL(TUNNEL_DATA),
31608 UAVCAN_NODE_INFO(UAVCAN_NODE_INFO_DATA),
31609 UAVCAN_NODE_STATUS(UAVCAN_NODE_STATUS_DATA),
31610 UTM_GLOBAL_POSITION(UTM_GLOBAL_POSITION_DATA),
31611 V2_EXTENSION(V2_EXTENSION_DATA),
31612 VFR_HUD(VFR_HUD_DATA),
31613 VIBRATION(VIBRATION_DATA),
31614 VICON_POSITION_ESTIMATE(VICON_POSITION_ESTIMATE_DATA),
31615 VIDEO_STREAM_INFORMATION(VIDEO_STREAM_INFORMATION_DATA),
31616 VIDEO_STREAM_STATUS(VIDEO_STREAM_STATUS_DATA),
31617 VISION_POSITION_ESTIMATE(VISION_POSITION_ESTIMATE_DATA),
31618 VISION_SPEED_ESTIMATE(VISION_SPEED_ESTIMATE_DATA),
31619 WHEEL_DISTANCE(WHEEL_DISTANCE_DATA),
31620 WIFI_CONFIG_AP(WIFI_CONFIG_AP_DATA),
31621 WINCH_STATUS(WINCH_STATUS_DATA),
31622 WIND_COV(WIND_COV_DATA),
31623}
31624impl MavMessage {
31625 pub const fn all_ids() -> &'static [u32] {
31626 &[
31627 0u32, 1u32, 2u32, 4u32, 5u32, 6u32, 7u32, 8u32, 11u32, 20u32, 21u32, 22u32, 23u32,
31628 24u32, 25u32, 26u32, 27u32, 28u32, 29u32, 30u32, 31u32, 32u32, 33u32, 34u32, 35u32,
31629 36u32, 37u32, 38u32, 39u32, 40u32, 41u32, 42u32, 43u32, 44u32, 45u32, 46u32, 47u32,
31630 48u32, 49u32, 50u32, 51u32, 54u32, 55u32, 61u32, 62u32, 63u32, 64u32, 65u32, 66u32,
31631 67u32, 69u32, 70u32, 73u32, 74u32, 75u32, 76u32, 77u32, 80u32, 81u32, 82u32, 83u32,
31632 84u32, 85u32, 86u32, 87u32, 89u32, 90u32, 91u32, 92u32, 93u32, 100u32, 101u32, 102u32,
31633 103u32, 104u32, 105u32, 106u32, 107u32, 108u32, 109u32, 110u32, 111u32, 112u32, 113u32,
31634 114u32, 115u32, 116u32, 117u32, 118u32, 119u32, 120u32, 121u32, 122u32, 123u32, 124u32,
31635 125u32, 126u32, 127u32, 128u32, 129u32, 130u32, 131u32, 132u32, 133u32, 134u32, 135u32,
31636 136u32, 137u32, 138u32, 139u32, 140u32, 141u32, 142u32, 143u32, 144u32, 146u32, 147u32,
31637 148u32, 149u32, 162u32, 180u32, 181u32, 182u32, 183u32, 184u32, 192u32, 225u32, 230u32,
31638 231u32, 232u32, 233u32, 234u32, 235u32, 241u32, 242u32, 243u32, 244u32, 245u32, 246u32,
31639 247u32, 248u32, 249u32, 250u32, 251u32, 252u32, 253u32, 254u32, 256u32, 257u32, 258u32,
31640 259u32, 260u32, 261u32, 262u32, 263u32, 264u32, 265u32, 266u32, 267u32, 268u32, 269u32,
31641 270u32, 271u32, 275u32, 276u32, 277u32, 280u32, 281u32, 282u32, 283u32, 284u32, 285u32,
31642 286u32, 287u32, 288u32, 290u32, 291u32, 299u32, 300u32, 301u32, 310u32, 311u32, 320u32,
31643 321u32, 322u32, 323u32, 324u32, 330u32, 331u32, 332u32, 333u32, 334u32, 335u32, 336u32,
31644 339u32, 340u32, 350u32, 360u32, 370u32, 371u32, 372u32, 373u32, 375u32, 380u32, 385u32,
31645 386u32, 387u32, 388u32, 390u32, 395u32, 396u32, 397u32, 400u32, 401u32, 410u32, 411u32,
31646 412u32, 413u32, 435u32, 436u32, 437u32, 440u32, 9000u32, 9005u32, 12900u32, 12901u32,
31647 12902u32, 12903u32, 12904u32, 12905u32, 12915u32, 12918u32, 12919u32, 12920u32,
31648 ]
31649 }
31650}
31651impl Message for MavMessage {
31652 fn parse(
31653 version: MavlinkVersion,
31654 id: u32,
31655 payload: &[u8],
31656 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31657 match id {
31658 ACTUATOR_CONTROL_TARGET_DATA::ID => {
31659 ACTUATOR_CONTROL_TARGET_DATA::deser(version, payload)
31660 .map(Self::ACTUATOR_CONTROL_TARGET)
31661 }
31662 ACTUATOR_OUTPUT_STATUS_DATA::ID => ACTUATOR_OUTPUT_STATUS_DATA::deser(version, payload)
31663 .map(Self::ACTUATOR_OUTPUT_STATUS),
31664 ADSB_VEHICLE_DATA::ID => {
31665 ADSB_VEHICLE_DATA::deser(version, payload).map(Self::ADSB_VEHICLE)
31666 }
31667 AIS_VESSEL_DATA::ID => AIS_VESSEL_DATA::deser(version, payload).map(Self::AIS_VESSEL),
31668 ALTITUDE_DATA::ID => ALTITUDE_DATA::deser(version, payload).map(Self::ALTITUDE),
31669 ATTITUDE_DATA::ID => ATTITUDE_DATA::deser(version, payload).map(Self::ATTITUDE),
31670 ATTITUDE_QUATERNION_DATA::ID => {
31671 ATTITUDE_QUATERNION_DATA::deser(version, payload).map(Self::ATTITUDE_QUATERNION)
31672 }
31673 ATTITUDE_QUATERNION_COV_DATA::ID => {
31674 ATTITUDE_QUATERNION_COV_DATA::deser(version, payload)
31675 .map(Self::ATTITUDE_QUATERNION_COV)
31676 }
31677 ATTITUDE_TARGET_DATA::ID => {
31678 ATTITUDE_TARGET_DATA::deser(version, payload).map(Self::ATTITUDE_TARGET)
31679 }
31680 ATT_POS_MOCAP_DATA::ID => {
31681 ATT_POS_MOCAP_DATA::deser(version, payload).map(Self::ATT_POS_MOCAP)
31682 }
31683 AUTH_KEY_DATA::ID => AUTH_KEY_DATA::deser(version, payload).map(Self::AUTH_KEY),
31684 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
31685 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::deser(version, payload)
31686 .map(Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE)
31687 }
31688 AUTOPILOT_VERSION_DATA::ID => {
31689 AUTOPILOT_VERSION_DATA::deser(version, payload).map(Self::AUTOPILOT_VERSION)
31690 }
31691 AVAILABLE_MODES_DATA::ID => {
31692 AVAILABLE_MODES_DATA::deser(version, payload).map(Self::AVAILABLE_MODES)
31693 }
31694 AVAILABLE_MODES_MONITOR_DATA::ID => {
31695 AVAILABLE_MODES_MONITOR_DATA::deser(version, payload)
31696 .map(Self::AVAILABLE_MODES_MONITOR)
31697 }
31698 BATTERY_INFO_DATA::ID => {
31699 BATTERY_INFO_DATA::deser(version, payload).map(Self::BATTERY_INFO)
31700 }
31701 BATTERY_STATUS_DATA::ID => {
31702 BATTERY_STATUS_DATA::deser(version, payload).map(Self::BATTERY_STATUS)
31703 }
31704 BUTTON_CHANGE_DATA::ID => {
31705 BUTTON_CHANGE_DATA::deser(version, payload).map(Self::BUTTON_CHANGE)
31706 }
31707 CAMERA_CAPTURE_STATUS_DATA::ID => {
31708 CAMERA_CAPTURE_STATUS_DATA::deser(version, payload).map(Self::CAMERA_CAPTURE_STATUS)
31709 }
31710 CAMERA_FOV_STATUS_DATA::ID => {
31711 CAMERA_FOV_STATUS_DATA::deser(version, payload).map(Self::CAMERA_FOV_STATUS)
31712 }
31713 CAMERA_IMAGE_CAPTURED_DATA::ID => {
31714 CAMERA_IMAGE_CAPTURED_DATA::deser(version, payload).map(Self::CAMERA_IMAGE_CAPTURED)
31715 }
31716 CAMERA_INFORMATION_DATA::ID => {
31717 CAMERA_INFORMATION_DATA::deser(version, payload).map(Self::CAMERA_INFORMATION)
31718 }
31719 CAMERA_SETTINGS_DATA::ID => {
31720 CAMERA_SETTINGS_DATA::deser(version, payload).map(Self::CAMERA_SETTINGS)
31721 }
31722 CAMERA_THERMAL_RANGE_DATA::ID => {
31723 CAMERA_THERMAL_RANGE_DATA::deser(version, payload).map(Self::CAMERA_THERMAL_RANGE)
31724 }
31725 CAMERA_TRACKING_GEO_STATUS_DATA::ID => {
31726 CAMERA_TRACKING_GEO_STATUS_DATA::deser(version, payload)
31727 .map(Self::CAMERA_TRACKING_GEO_STATUS)
31728 }
31729 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => {
31730 CAMERA_TRACKING_IMAGE_STATUS_DATA::deser(version, payload)
31731 .map(Self::CAMERA_TRACKING_IMAGE_STATUS)
31732 }
31733 CAMERA_TRIGGER_DATA::ID => {
31734 CAMERA_TRIGGER_DATA::deser(version, payload).map(Self::CAMERA_TRIGGER)
31735 }
31736 CANFD_FRAME_DATA::ID => {
31737 CANFD_FRAME_DATA::deser(version, payload).map(Self::CANFD_FRAME)
31738 }
31739 CAN_FILTER_MODIFY_DATA::ID => {
31740 CAN_FILTER_MODIFY_DATA::deser(version, payload).map(Self::CAN_FILTER_MODIFY)
31741 }
31742 CAN_FRAME_DATA::ID => CAN_FRAME_DATA::deser(version, payload).map(Self::CAN_FRAME),
31743 CELLULAR_CONFIG_DATA::ID => {
31744 CELLULAR_CONFIG_DATA::deser(version, payload).map(Self::CELLULAR_CONFIG)
31745 }
31746 CELLULAR_STATUS_DATA::ID => {
31747 CELLULAR_STATUS_DATA::deser(version, payload).map(Self::CELLULAR_STATUS)
31748 }
31749 CHANGE_OPERATOR_CONTROL_DATA::ID => {
31750 CHANGE_OPERATOR_CONTROL_DATA::deser(version, payload)
31751 .map(Self::CHANGE_OPERATOR_CONTROL)
31752 }
31753 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => {
31754 CHANGE_OPERATOR_CONTROL_ACK_DATA::deser(version, payload)
31755 .map(Self::CHANGE_OPERATOR_CONTROL_ACK)
31756 }
31757 COLLISION_DATA::ID => COLLISION_DATA::deser(version, payload).map(Self::COLLISION),
31758 COMMAND_ACK_DATA::ID => {
31759 COMMAND_ACK_DATA::deser(version, payload).map(Self::COMMAND_ACK)
31760 }
31761 COMMAND_CANCEL_DATA::ID => {
31762 COMMAND_CANCEL_DATA::deser(version, payload).map(Self::COMMAND_CANCEL)
31763 }
31764 COMMAND_INT_DATA::ID => {
31765 COMMAND_INT_DATA::deser(version, payload).map(Self::COMMAND_INT)
31766 }
31767 COMMAND_LONG_DATA::ID => {
31768 COMMAND_LONG_DATA::deser(version, payload).map(Self::COMMAND_LONG)
31769 }
31770 COMPONENT_INFORMATION_DATA::ID => {
31771 COMPONENT_INFORMATION_DATA::deser(version, payload).map(Self::COMPONENT_INFORMATION)
31772 }
31773 COMPONENT_INFORMATION_BASIC_DATA::ID => {
31774 COMPONENT_INFORMATION_BASIC_DATA::deser(version, payload)
31775 .map(Self::COMPONENT_INFORMATION_BASIC)
31776 }
31777 COMPONENT_METADATA_DATA::ID => {
31778 COMPONENT_METADATA_DATA::deser(version, payload).map(Self::COMPONENT_METADATA)
31779 }
31780 CONTROL_SYSTEM_STATE_DATA::ID => {
31781 CONTROL_SYSTEM_STATE_DATA::deser(version, payload).map(Self::CONTROL_SYSTEM_STATE)
31782 }
31783 CURRENT_EVENT_SEQUENCE_DATA::ID => CURRENT_EVENT_SEQUENCE_DATA::deser(version, payload)
31784 .map(Self::CURRENT_EVENT_SEQUENCE),
31785 CURRENT_MODE_DATA::ID => {
31786 CURRENT_MODE_DATA::deser(version, payload).map(Self::CURRENT_MODE)
31787 }
31788 DATA_STREAM_DATA::ID => {
31789 DATA_STREAM_DATA::deser(version, payload).map(Self::DATA_STREAM)
31790 }
31791 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => {
31792 DATA_TRANSMISSION_HANDSHAKE_DATA::deser(version, payload)
31793 .map(Self::DATA_TRANSMISSION_HANDSHAKE)
31794 }
31795 DEBUG_DATA::ID => DEBUG_DATA::deser(version, payload).map(Self::DEBUG),
31796 DEBUG_FLOAT_ARRAY_DATA::ID => {
31797 DEBUG_FLOAT_ARRAY_DATA::deser(version, payload).map(Self::DEBUG_FLOAT_ARRAY)
31798 }
31799 DEBUG_VECT_DATA::ID => DEBUG_VECT_DATA::deser(version, payload).map(Self::DEBUG_VECT),
31800 DISTANCE_SENSOR_DATA::ID => {
31801 DISTANCE_SENSOR_DATA::deser(version, payload).map(Self::DISTANCE_SENSOR)
31802 }
31803 EFI_STATUS_DATA::ID => EFI_STATUS_DATA::deser(version, payload).map(Self::EFI_STATUS),
31804 ENCAPSULATED_DATA_DATA::ID => {
31805 ENCAPSULATED_DATA_DATA::deser(version, payload).map(Self::ENCAPSULATED_DATA)
31806 }
31807 ESC_INFO_DATA::ID => ESC_INFO_DATA::deser(version, payload).map(Self::ESC_INFO),
31808 ESC_STATUS_DATA::ID => ESC_STATUS_DATA::deser(version, payload).map(Self::ESC_STATUS),
31809 ESTIMATOR_STATUS_DATA::ID => {
31810 ESTIMATOR_STATUS_DATA::deser(version, payload).map(Self::ESTIMATOR_STATUS)
31811 }
31812 EVENT_DATA::ID => EVENT_DATA::deser(version, payload).map(Self::EVENT),
31813 EXTENDED_SYS_STATE_DATA::ID => {
31814 EXTENDED_SYS_STATE_DATA::deser(version, payload).map(Self::EXTENDED_SYS_STATE)
31815 }
31816 FENCE_STATUS_DATA::ID => {
31817 FENCE_STATUS_DATA::deser(version, payload).map(Self::FENCE_STATUS)
31818 }
31819 FILE_TRANSFER_PROTOCOL_DATA::ID => FILE_TRANSFER_PROTOCOL_DATA::deser(version, payload)
31820 .map(Self::FILE_TRANSFER_PROTOCOL),
31821 FLIGHT_INFORMATION_DATA::ID => {
31822 FLIGHT_INFORMATION_DATA::deser(version, payload).map(Self::FLIGHT_INFORMATION)
31823 }
31824 FOLLOW_TARGET_DATA::ID => {
31825 FOLLOW_TARGET_DATA::deser(version, payload).map(Self::FOLLOW_TARGET)
31826 }
31827 FUEL_STATUS_DATA::ID => {
31828 FUEL_STATUS_DATA::deser(version, payload).map(Self::FUEL_STATUS)
31829 }
31830 GENERATOR_STATUS_DATA::ID => {
31831 GENERATOR_STATUS_DATA::deser(version, payload).map(Self::GENERATOR_STATUS)
31832 }
31833 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => {
31834 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::deser(version, payload)
31835 .map(Self::GIMBAL_DEVICE_ATTITUDE_STATUS)
31836 }
31837 GIMBAL_DEVICE_INFORMATION_DATA::ID => {
31838 GIMBAL_DEVICE_INFORMATION_DATA::deser(version, payload)
31839 .map(Self::GIMBAL_DEVICE_INFORMATION)
31840 }
31841 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => {
31842 GIMBAL_DEVICE_SET_ATTITUDE_DATA::deser(version, payload)
31843 .map(Self::GIMBAL_DEVICE_SET_ATTITUDE)
31844 }
31845 GIMBAL_MANAGER_INFORMATION_DATA::ID => {
31846 GIMBAL_MANAGER_INFORMATION_DATA::deser(version, payload)
31847 .map(Self::GIMBAL_MANAGER_INFORMATION)
31848 }
31849 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => {
31850 GIMBAL_MANAGER_SET_ATTITUDE_DATA::deser(version, payload)
31851 .map(Self::GIMBAL_MANAGER_SET_ATTITUDE)
31852 }
31853 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
31854 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::deser(version, payload)
31855 .map(Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL)
31856 }
31857 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => {
31858 GIMBAL_MANAGER_SET_PITCHYAW_DATA::deser(version, payload)
31859 .map(Self::GIMBAL_MANAGER_SET_PITCHYAW)
31860 }
31861 GIMBAL_MANAGER_STATUS_DATA::ID => {
31862 GIMBAL_MANAGER_STATUS_DATA::deser(version, payload).map(Self::GIMBAL_MANAGER_STATUS)
31863 }
31864 GLOBAL_POSITION_INT_DATA::ID => {
31865 GLOBAL_POSITION_INT_DATA::deser(version, payload).map(Self::GLOBAL_POSITION_INT)
31866 }
31867 GLOBAL_POSITION_INT_COV_DATA::ID => {
31868 GLOBAL_POSITION_INT_COV_DATA::deser(version, payload)
31869 .map(Self::GLOBAL_POSITION_INT_COV)
31870 }
31871 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
31872 GLOBAL_VISION_POSITION_ESTIMATE_DATA::deser(version, payload)
31873 .map(Self::GLOBAL_VISION_POSITION_ESTIMATE)
31874 }
31875 GPS2_RAW_DATA::ID => GPS2_RAW_DATA::deser(version, payload).map(Self::GPS2_RAW),
31876 GPS2_RTK_DATA::ID => GPS2_RTK_DATA::deser(version, payload).map(Self::GPS2_RTK),
31877 GPS_GLOBAL_ORIGIN_DATA::ID => {
31878 GPS_GLOBAL_ORIGIN_DATA::deser(version, payload).map(Self::GPS_GLOBAL_ORIGIN)
31879 }
31880 GPS_INJECT_DATA_DATA::ID => {
31881 GPS_INJECT_DATA_DATA::deser(version, payload).map(Self::GPS_INJECT_DATA)
31882 }
31883 GPS_INPUT_DATA::ID => GPS_INPUT_DATA::deser(version, payload).map(Self::GPS_INPUT),
31884 GPS_RAW_INT_DATA::ID => {
31885 GPS_RAW_INT_DATA::deser(version, payload).map(Self::GPS_RAW_INT)
31886 }
31887 GPS_RTCM_DATA_DATA::ID => {
31888 GPS_RTCM_DATA_DATA::deser(version, payload).map(Self::GPS_RTCM_DATA)
31889 }
31890 GPS_RTK_DATA::ID => GPS_RTK_DATA::deser(version, payload).map(Self::GPS_RTK),
31891 GPS_STATUS_DATA::ID => GPS_STATUS_DATA::deser(version, payload).map(Self::GPS_STATUS),
31892 HEARTBEAT_DATA::ID => HEARTBEAT_DATA::deser(version, payload).map(Self::HEARTBEAT),
31893 HIGHRES_IMU_DATA::ID => {
31894 HIGHRES_IMU_DATA::deser(version, payload).map(Self::HIGHRES_IMU)
31895 }
31896 HIGH_LATENCY_DATA::ID => {
31897 HIGH_LATENCY_DATA::deser(version, payload).map(Self::HIGH_LATENCY)
31898 }
31899 HIGH_LATENCY2_DATA::ID => {
31900 HIGH_LATENCY2_DATA::deser(version, payload).map(Self::HIGH_LATENCY2)
31901 }
31902 HIL_ACTUATOR_CONTROLS_DATA::ID => {
31903 HIL_ACTUATOR_CONTROLS_DATA::deser(version, payload).map(Self::HIL_ACTUATOR_CONTROLS)
31904 }
31905 HIL_CONTROLS_DATA::ID => {
31906 HIL_CONTROLS_DATA::deser(version, payload).map(Self::HIL_CONTROLS)
31907 }
31908 HIL_GPS_DATA::ID => HIL_GPS_DATA::deser(version, payload).map(Self::HIL_GPS),
31909 HIL_OPTICAL_FLOW_DATA::ID => {
31910 HIL_OPTICAL_FLOW_DATA::deser(version, payload).map(Self::HIL_OPTICAL_FLOW)
31911 }
31912 HIL_RC_INPUTS_RAW_DATA::ID => {
31913 HIL_RC_INPUTS_RAW_DATA::deser(version, payload).map(Self::HIL_RC_INPUTS_RAW)
31914 }
31915 HIL_SENSOR_DATA::ID => HIL_SENSOR_DATA::deser(version, payload).map(Self::HIL_SENSOR),
31916 HIL_STATE_DATA::ID => HIL_STATE_DATA::deser(version, payload).map(Self::HIL_STATE),
31917 HIL_STATE_QUATERNION_DATA::ID => {
31918 HIL_STATE_QUATERNION_DATA::deser(version, payload).map(Self::HIL_STATE_QUATERNION)
31919 }
31920 HOME_POSITION_DATA::ID => {
31921 HOME_POSITION_DATA::deser(version, payload).map(Self::HOME_POSITION)
31922 }
31923 HYGROMETER_SENSOR_DATA::ID => {
31924 HYGROMETER_SENSOR_DATA::deser(version, payload).map(Self::HYGROMETER_SENSOR)
31925 }
31926 ILLUMINATOR_STATUS_DATA::ID => {
31927 ILLUMINATOR_STATUS_DATA::deser(version, payload).map(Self::ILLUMINATOR_STATUS)
31928 }
31929 ISBD_LINK_STATUS_DATA::ID => {
31930 ISBD_LINK_STATUS_DATA::deser(version, payload).map(Self::ISBD_LINK_STATUS)
31931 }
31932 LANDING_TARGET_DATA::ID => {
31933 LANDING_TARGET_DATA::deser(version, payload).map(Self::LANDING_TARGET)
31934 }
31935 LINK_NODE_STATUS_DATA::ID => {
31936 LINK_NODE_STATUS_DATA::deser(version, payload).map(Self::LINK_NODE_STATUS)
31937 }
31938 LOCAL_POSITION_NED_DATA::ID => {
31939 LOCAL_POSITION_NED_DATA::deser(version, payload).map(Self::LOCAL_POSITION_NED)
31940 }
31941 LOCAL_POSITION_NED_COV_DATA::ID => LOCAL_POSITION_NED_COV_DATA::deser(version, payload)
31942 .map(Self::LOCAL_POSITION_NED_COV),
31943 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
31944 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::deser(version, payload)
31945 .map(Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET)
31946 }
31947 LOGGING_ACK_DATA::ID => {
31948 LOGGING_ACK_DATA::deser(version, payload).map(Self::LOGGING_ACK)
31949 }
31950 LOGGING_DATA_DATA::ID => {
31951 LOGGING_DATA_DATA::deser(version, payload).map(Self::LOGGING_DATA)
31952 }
31953 LOGGING_DATA_ACKED_DATA::ID => {
31954 LOGGING_DATA_ACKED_DATA::deser(version, payload).map(Self::LOGGING_DATA_ACKED)
31955 }
31956 LOG_DATA_DATA::ID => LOG_DATA_DATA::deser(version, payload).map(Self::LOG_DATA),
31957 LOG_ENTRY_DATA::ID => LOG_ENTRY_DATA::deser(version, payload).map(Self::LOG_ENTRY),
31958 LOG_ERASE_DATA::ID => LOG_ERASE_DATA::deser(version, payload).map(Self::LOG_ERASE),
31959 LOG_REQUEST_DATA_DATA::ID => {
31960 LOG_REQUEST_DATA_DATA::deser(version, payload).map(Self::LOG_REQUEST_DATA)
31961 }
31962 LOG_REQUEST_END_DATA::ID => {
31963 LOG_REQUEST_END_DATA::deser(version, payload).map(Self::LOG_REQUEST_END)
31964 }
31965 LOG_REQUEST_LIST_DATA::ID => {
31966 LOG_REQUEST_LIST_DATA::deser(version, payload).map(Self::LOG_REQUEST_LIST)
31967 }
31968 MAG_CAL_REPORT_DATA::ID => {
31969 MAG_CAL_REPORT_DATA::deser(version, payload).map(Self::MAG_CAL_REPORT)
31970 }
31971 MANUAL_CONTROL_DATA::ID => {
31972 MANUAL_CONTROL_DATA::deser(version, payload).map(Self::MANUAL_CONTROL)
31973 }
31974 MANUAL_SETPOINT_DATA::ID => {
31975 MANUAL_SETPOINT_DATA::deser(version, payload).map(Self::MANUAL_SETPOINT)
31976 }
31977 MEMORY_VECT_DATA::ID => {
31978 MEMORY_VECT_DATA::deser(version, payload).map(Self::MEMORY_VECT)
31979 }
31980 MESSAGE_INTERVAL_DATA::ID => {
31981 MESSAGE_INTERVAL_DATA::deser(version, payload).map(Self::MESSAGE_INTERVAL)
31982 }
31983 MISSION_ACK_DATA::ID => {
31984 MISSION_ACK_DATA::deser(version, payload).map(Self::MISSION_ACK)
31985 }
31986 MISSION_CLEAR_ALL_DATA::ID => {
31987 MISSION_CLEAR_ALL_DATA::deser(version, payload).map(Self::MISSION_CLEAR_ALL)
31988 }
31989 MISSION_COUNT_DATA::ID => {
31990 MISSION_COUNT_DATA::deser(version, payload).map(Self::MISSION_COUNT)
31991 }
31992 MISSION_CURRENT_DATA::ID => {
31993 MISSION_CURRENT_DATA::deser(version, payload).map(Self::MISSION_CURRENT)
31994 }
31995 MISSION_ITEM_DATA::ID => {
31996 MISSION_ITEM_DATA::deser(version, payload).map(Self::MISSION_ITEM)
31997 }
31998 MISSION_ITEM_INT_DATA::ID => {
31999 MISSION_ITEM_INT_DATA::deser(version, payload).map(Self::MISSION_ITEM_INT)
32000 }
32001 MISSION_ITEM_REACHED_DATA::ID => {
32002 MISSION_ITEM_REACHED_DATA::deser(version, payload).map(Self::MISSION_ITEM_REACHED)
32003 }
32004 MISSION_REQUEST_DATA::ID => {
32005 MISSION_REQUEST_DATA::deser(version, payload).map(Self::MISSION_REQUEST)
32006 }
32007 MISSION_REQUEST_INT_DATA::ID => {
32008 MISSION_REQUEST_INT_DATA::deser(version, payload).map(Self::MISSION_REQUEST_INT)
32009 }
32010 MISSION_REQUEST_LIST_DATA::ID => {
32011 MISSION_REQUEST_LIST_DATA::deser(version, payload).map(Self::MISSION_REQUEST_LIST)
32012 }
32013 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => {
32014 MISSION_REQUEST_PARTIAL_LIST_DATA::deser(version, payload)
32015 .map(Self::MISSION_REQUEST_PARTIAL_LIST)
32016 }
32017 MISSION_SET_CURRENT_DATA::ID => {
32018 MISSION_SET_CURRENT_DATA::deser(version, payload).map(Self::MISSION_SET_CURRENT)
32019 }
32020 MISSION_WRITE_PARTIAL_LIST_DATA::ID => {
32021 MISSION_WRITE_PARTIAL_LIST_DATA::deser(version, payload)
32022 .map(Self::MISSION_WRITE_PARTIAL_LIST)
32023 }
32024 MOUNT_ORIENTATION_DATA::ID => {
32025 MOUNT_ORIENTATION_DATA::deser(version, payload).map(Self::MOUNT_ORIENTATION)
32026 }
32027 NAMED_VALUE_FLOAT_DATA::ID => {
32028 NAMED_VALUE_FLOAT_DATA::deser(version, payload).map(Self::NAMED_VALUE_FLOAT)
32029 }
32030 NAMED_VALUE_INT_DATA::ID => {
32031 NAMED_VALUE_INT_DATA::deser(version, payload).map(Self::NAMED_VALUE_INT)
32032 }
32033 NAV_CONTROLLER_OUTPUT_DATA::ID => {
32034 NAV_CONTROLLER_OUTPUT_DATA::deser(version, payload).map(Self::NAV_CONTROLLER_OUTPUT)
32035 }
32036 OBSTACLE_DISTANCE_DATA::ID => {
32037 OBSTACLE_DISTANCE_DATA::deser(version, payload).map(Self::OBSTACLE_DISTANCE)
32038 }
32039 ODOMETRY_DATA::ID => ODOMETRY_DATA::deser(version, payload).map(Self::ODOMETRY),
32040 ONBOARD_COMPUTER_STATUS_DATA::ID => {
32041 ONBOARD_COMPUTER_STATUS_DATA::deser(version, payload)
32042 .map(Self::ONBOARD_COMPUTER_STATUS)
32043 }
32044 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => {
32045 OPEN_DRONE_ID_ARM_STATUS_DATA::deser(version, payload)
32046 .map(Self::OPEN_DRONE_ID_ARM_STATUS)
32047 }
32048 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => {
32049 OPEN_DRONE_ID_AUTHENTICATION_DATA::deser(version, payload)
32050 .map(Self::OPEN_DRONE_ID_AUTHENTICATION)
32051 }
32052 OPEN_DRONE_ID_BASIC_ID_DATA::ID => OPEN_DRONE_ID_BASIC_ID_DATA::deser(version, payload)
32053 .map(Self::OPEN_DRONE_ID_BASIC_ID),
32054 OPEN_DRONE_ID_LOCATION_DATA::ID => OPEN_DRONE_ID_LOCATION_DATA::deser(version, payload)
32055 .map(Self::OPEN_DRONE_ID_LOCATION),
32056 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => {
32057 OPEN_DRONE_ID_MESSAGE_PACK_DATA::deser(version, payload)
32058 .map(Self::OPEN_DRONE_ID_MESSAGE_PACK)
32059 }
32060 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => {
32061 OPEN_DRONE_ID_OPERATOR_ID_DATA::deser(version, payload)
32062 .map(Self::OPEN_DRONE_ID_OPERATOR_ID)
32063 }
32064 OPEN_DRONE_ID_SELF_ID_DATA::ID => {
32065 OPEN_DRONE_ID_SELF_ID_DATA::deser(version, payload).map(Self::OPEN_DRONE_ID_SELF_ID)
32066 }
32067 OPEN_DRONE_ID_SYSTEM_DATA::ID => {
32068 OPEN_DRONE_ID_SYSTEM_DATA::deser(version, payload).map(Self::OPEN_DRONE_ID_SYSTEM)
32069 }
32070 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => {
32071 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::deser(version, payload)
32072 .map(Self::OPEN_DRONE_ID_SYSTEM_UPDATE)
32073 }
32074 OPTICAL_FLOW_DATA::ID => {
32075 OPTICAL_FLOW_DATA::deser(version, payload).map(Self::OPTICAL_FLOW)
32076 }
32077 OPTICAL_FLOW_RAD_DATA::ID => {
32078 OPTICAL_FLOW_RAD_DATA::deser(version, payload).map(Self::OPTICAL_FLOW_RAD)
32079 }
32080 ORBIT_EXECUTION_STATUS_DATA::ID => ORBIT_EXECUTION_STATUS_DATA::deser(version, payload)
32081 .map(Self::ORBIT_EXECUTION_STATUS),
32082 PARAM_EXT_ACK_DATA::ID => {
32083 PARAM_EXT_ACK_DATA::deser(version, payload).map(Self::PARAM_EXT_ACK)
32084 }
32085 PARAM_EXT_REQUEST_LIST_DATA::ID => PARAM_EXT_REQUEST_LIST_DATA::deser(version, payload)
32086 .map(Self::PARAM_EXT_REQUEST_LIST),
32087 PARAM_EXT_REQUEST_READ_DATA::ID => PARAM_EXT_REQUEST_READ_DATA::deser(version, payload)
32088 .map(Self::PARAM_EXT_REQUEST_READ),
32089 PARAM_EXT_SET_DATA::ID => {
32090 PARAM_EXT_SET_DATA::deser(version, payload).map(Self::PARAM_EXT_SET)
32091 }
32092 PARAM_EXT_VALUE_DATA::ID => {
32093 PARAM_EXT_VALUE_DATA::deser(version, payload).map(Self::PARAM_EXT_VALUE)
32094 }
32095 PARAM_MAP_RC_DATA::ID => {
32096 PARAM_MAP_RC_DATA::deser(version, payload).map(Self::PARAM_MAP_RC)
32097 }
32098 PARAM_REQUEST_LIST_DATA::ID => {
32099 PARAM_REQUEST_LIST_DATA::deser(version, payload).map(Self::PARAM_REQUEST_LIST)
32100 }
32101 PARAM_REQUEST_READ_DATA::ID => {
32102 PARAM_REQUEST_READ_DATA::deser(version, payload).map(Self::PARAM_REQUEST_READ)
32103 }
32104 PARAM_SET_DATA::ID => PARAM_SET_DATA::deser(version, payload).map(Self::PARAM_SET),
32105 PARAM_VALUE_DATA::ID => {
32106 PARAM_VALUE_DATA::deser(version, payload).map(Self::PARAM_VALUE)
32107 }
32108 PING_DATA::ID => PING_DATA::deser(version, payload).map(Self::PING),
32109 PLAY_TUNE_DATA::ID => PLAY_TUNE_DATA::deser(version, payload).map(Self::PLAY_TUNE),
32110 PLAY_TUNE_V2_DATA::ID => {
32111 PLAY_TUNE_V2_DATA::deser(version, payload).map(Self::PLAY_TUNE_V2)
32112 }
32113 POSITION_TARGET_GLOBAL_INT_DATA::ID => {
32114 POSITION_TARGET_GLOBAL_INT_DATA::deser(version, payload)
32115 .map(Self::POSITION_TARGET_GLOBAL_INT)
32116 }
32117 POSITION_TARGET_LOCAL_NED_DATA::ID => {
32118 POSITION_TARGET_LOCAL_NED_DATA::deser(version, payload)
32119 .map(Self::POSITION_TARGET_LOCAL_NED)
32120 }
32121 POWER_STATUS_DATA::ID => {
32122 POWER_STATUS_DATA::deser(version, payload).map(Self::POWER_STATUS)
32123 }
32124 PROTOCOL_VERSION_DATA::ID => {
32125 PROTOCOL_VERSION_DATA::deser(version, payload).map(Self::PROTOCOL_VERSION)
32126 }
32127 RADIO_STATUS_DATA::ID => {
32128 RADIO_STATUS_DATA::deser(version, payload).map(Self::RADIO_STATUS)
32129 }
32130 RAW_IMU_DATA::ID => RAW_IMU_DATA::deser(version, payload).map(Self::RAW_IMU),
32131 RAW_PRESSURE_DATA::ID => {
32132 RAW_PRESSURE_DATA::deser(version, payload).map(Self::RAW_PRESSURE)
32133 }
32134 RAW_RPM_DATA::ID => RAW_RPM_DATA::deser(version, payload).map(Self::RAW_RPM),
32135 RC_CHANNELS_DATA::ID => {
32136 RC_CHANNELS_DATA::deser(version, payload).map(Self::RC_CHANNELS)
32137 }
32138 RC_CHANNELS_OVERRIDE_DATA::ID => {
32139 RC_CHANNELS_OVERRIDE_DATA::deser(version, payload).map(Self::RC_CHANNELS_OVERRIDE)
32140 }
32141 RC_CHANNELS_RAW_DATA::ID => {
32142 RC_CHANNELS_RAW_DATA::deser(version, payload).map(Self::RC_CHANNELS_RAW)
32143 }
32144 RC_CHANNELS_SCALED_DATA::ID => {
32145 RC_CHANNELS_SCALED_DATA::deser(version, payload).map(Self::RC_CHANNELS_SCALED)
32146 }
32147 REQUEST_DATA_STREAM_DATA::ID => {
32148 REQUEST_DATA_STREAM_DATA::deser(version, payload).map(Self::REQUEST_DATA_STREAM)
32149 }
32150 REQUEST_EVENT_DATA::ID => {
32151 REQUEST_EVENT_DATA::deser(version, payload).map(Self::REQUEST_EVENT)
32152 }
32153 RESOURCE_REQUEST_DATA::ID => {
32154 RESOURCE_REQUEST_DATA::deser(version, payload).map(Self::RESOURCE_REQUEST)
32155 }
32156 RESPONSE_EVENT_ERROR_DATA::ID => {
32157 RESPONSE_EVENT_ERROR_DATA::deser(version, payload).map(Self::RESPONSE_EVENT_ERROR)
32158 }
32159 SAFETY_ALLOWED_AREA_DATA::ID => {
32160 SAFETY_ALLOWED_AREA_DATA::deser(version, payload).map(Self::SAFETY_ALLOWED_AREA)
32161 }
32162 SAFETY_SET_ALLOWED_AREA_DATA::ID => {
32163 SAFETY_SET_ALLOWED_AREA_DATA::deser(version, payload)
32164 .map(Self::SAFETY_SET_ALLOWED_AREA)
32165 }
32166 SCALED_IMU_DATA::ID => SCALED_IMU_DATA::deser(version, payload).map(Self::SCALED_IMU),
32167 SCALED_IMU2_DATA::ID => {
32168 SCALED_IMU2_DATA::deser(version, payload).map(Self::SCALED_IMU2)
32169 }
32170 SCALED_IMU3_DATA::ID => {
32171 SCALED_IMU3_DATA::deser(version, payload).map(Self::SCALED_IMU3)
32172 }
32173 SCALED_PRESSURE_DATA::ID => {
32174 SCALED_PRESSURE_DATA::deser(version, payload).map(Self::SCALED_PRESSURE)
32175 }
32176 SCALED_PRESSURE2_DATA::ID => {
32177 SCALED_PRESSURE2_DATA::deser(version, payload).map(Self::SCALED_PRESSURE2)
32178 }
32179 SCALED_PRESSURE3_DATA::ID => {
32180 SCALED_PRESSURE3_DATA::deser(version, payload).map(Self::SCALED_PRESSURE3)
32181 }
32182 SCRIPT_COUNT_DATA::ID => {
32183 SCRIPT_COUNT_DATA::deser(version, payload).map(Self::SCRIPT_COUNT)
32184 }
32185 SCRIPT_CURRENT_DATA::ID => {
32186 SCRIPT_CURRENT_DATA::deser(version, payload).map(Self::SCRIPT_CURRENT)
32187 }
32188 SCRIPT_ITEM_DATA::ID => {
32189 SCRIPT_ITEM_DATA::deser(version, payload).map(Self::SCRIPT_ITEM)
32190 }
32191 SCRIPT_REQUEST_DATA::ID => {
32192 SCRIPT_REQUEST_DATA::deser(version, payload).map(Self::SCRIPT_REQUEST)
32193 }
32194 SCRIPT_REQUEST_LIST_DATA::ID => {
32195 SCRIPT_REQUEST_LIST_DATA::deser(version, payload).map(Self::SCRIPT_REQUEST_LIST)
32196 }
32197 SERIAL_CONTROL_DATA::ID => {
32198 SERIAL_CONTROL_DATA::deser(version, payload).map(Self::SERIAL_CONTROL)
32199 }
32200 SERVO_OUTPUT_RAW_DATA::ID => {
32201 SERVO_OUTPUT_RAW_DATA::deser(version, payload).map(Self::SERVO_OUTPUT_RAW)
32202 }
32203 SETUP_SIGNING_DATA::ID => {
32204 SETUP_SIGNING_DATA::deser(version, payload).map(Self::SETUP_SIGNING)
32205 }
32206 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => {
32207 SET_ACTUATOR_CONTROL_TARGET_DATA::deser(version, payload)
32208 .map(Self::SET_ACTUATOR_CONTROL_TARGET)
32209 }
32210 SET_ATTITUDE_TARGET_DATA::ID => {
32211 SET_ATTITUDE_TARGET_DATA::deser(version, payload).map(Self::SET_ATTITUDE_TARGET)
32212 }
32213 SET_GPS_GLOBAL_ORIGIN_DATA::ID => {
32214 SET_GPS_GLOBAL_ORIGIN_DATA::deser(version, payload).map(Self::SET_GPS_GLOBAL_ORIGIN)
32215 }
32216 SET_HOME_POSITION_DATA::ID => {
32217 SET_HOME_POSITION_DATA::deser(version, payload).map(Self::SET_HOME_POSITION)
32218 }
32219 SET_MODE_DATA::ID => SET_MODE_DATA::deser(version, payload).map(Self::SET_MODE),
32220 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => {
32221 SET_POSITION_TARGET_GLOBAL_INT_DATA::deser(version, payload)
32222 .map(Self::SET_POSITION_TARGET_GLOBAL_INT)
32223 }
32224 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => {
32225 SET_POSITION_TARGET_LOCAL_NED_DATA::deser(version, payload)
32226 .map(Self::SET_POSITION_TARGET_LOCAL_NED)
32227 }
32228 SIM_STATE_DATA::ID => SIM_STATE_DATA::deser(version, payload).map(Self::SIM_STATE),
32229 SMART_BATTERY_INFO_DATA::ID => {
32230 SMART_BATTERY_INFO_DATA::deser(version, payload).map(Self::SMART_BATTERY_INFO)
32231 }
32232 STATUSTEXT_DATA::ID => STATUSTEXT_DATA::deser(version, payload).map(Self::STATUSTEXT),
32233 STORAGE_INFORMATION_DATA::ID => {
32234 STORAGE_INFORMATION_DATA::deser(version, payload).map(Self::STORAGE_INFORMATION)
32235 }
32236 SUPPORTED_TUNES_DATA::ID => {
32237 SUPPORTED_TUNES_DATA::deser(version, payload).map(Self::SUPPORTED_TUNES)
32238 }
32239 SYSTEM_TIME_DATA::ID => {
32240 SYSTEM_TIME_DATA::deser(version, payload).map(Self::SYSTEM_TIME)
32241 }
32242 SYS_STATUS_DATA::ID => SYS_STATUS_DATA::deser(version, payload).map(Self::SYS_STATUS),
32243 TERRAIN_CHECK_DATA::ID => {
32244 TERRAIN_CHECK_DATA::deser(version, payload).map(Self::TERRAIN_CHECK)
32245 }
32246 TERRAIN_DATA_DATA::ID => {
32247 TERRAIN_DATA_DATA::deser(version, payload).map(Self::TERRAIN_DATA)
32248 }
32249 TERRAIN_REPORT_DATA::ID => {
32250 TERRAIN_REPORT_DATA::deser(version, payload).map(Self::TERRAIN_REPORT)
32251 }
32252 TERRAIN_REQUEST_DATA::ID => {
32253 TERRAIN_REQUEST_DATA::deser(version, payload).map(Self::TERRAIN_REQUEST)
32254 }
32255 TIMESYNC_DATA::ID => TIMESYNC_DATA::deser(version, payload).map(Self::TIMESYNC),
32256 TIME_ESTIMATE_TO_TARGET_DATA::ID => {
32257 TIME_ESTIMATE_TO_TARGET_DATA::deser(version, payload)
32258 .map(Self::TIME_ESTIMATE_TO_TARGET)
32259 }
32260 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
32261 TRAJECTORY_REPRESENTATION_BEZIER_DATA::deser(version, payload)
32262 .map(Self::TRAJECTORY_REPRESENTATION_BEZIER)
32263 }
32264 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
32265 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::deser(version, payload)
32266 .map(Self::TRAJECTORY_REPRESENTATION_WAYPOINTS)
32267 }
32268 TUNNEL_DATA::ID => TUNNEL_DATA::deser(version, payload).map(Self::TUNNEL),
32269 UAVCAN_NODE_INFO_DATA::ID => {
32270 UAVCAN_NODE_INFO_DATA::deser(version, payload).map(Self::UAVCAN_NODE_INFO)
32271 }
32272 UAVCAN_NODE_STATUS_DATA::ID => {
32273 UAVCAN_NODE_STATUS_DATA::deser(version, payload).map(Self::UAVCAN_NODE_STATUS)
32274 }
32275 UTM_GLOBAL_POSITION_DATA::ID => {
32276 UTM_GLOBAL_POSITION_DATA::deser(version, payload).map(Self::UTM_GLOBAL_POSITION)
32277 }
32278 V2_EXTENSION_DATA::ID => {
32279 V2_EXTENSION_DATA::deser(version, payload).map(Self::V2_EXTENSION)
32280 }
32281 VFR_HUD_DATA::ID => VFR_HUD_DATA::deser(version, payload).map(Self::VFR_HUD),
32282 VIBRATION_DATA::ID => VIBRATION_DATA::deser(version, payload).map(Self::VIBRATION),
32283 VICON_POSITION_ESTIMATE_DATA::ID => {
32284 VICON_POSITION_ESTIMATE_DATA::deser(version, payload)
32285 .map(Self::VICON_POSITION_ESTIMATE)
32286 }
32287 VIDEO_STREAM_INFORMATION_DATA::ID => {
32288 VIDEO_STREAM_INFORMATION_DATA::deser(version, payload)
32289 .map(Self::VIDEO_STREAM_INFORMATION)
32290 }
32291 VIDEO_STREAM_STATUS_DATA::ID => {
32292 VIDEO_STREAM_STATUS_DATA::deser(version, payload).map(Self::VIDEO_STREAM_STATUS)
32293 }
32294 VISION_POSITION_ESTIMATE_DATA::ID => {
32295 VISION_POSITION_ESTIMATE_DATA::deser(version, payload)
32296 .map(Self::VISION_POSITION_ESTIMATE)
32297 }
32298 VISION_SPEED_ESTIMATE_DATA::ID => {
32299 VISION_SPEED_ESTIMATE_DATA::deser(version, payload).map(Self::VISION_SPEED_ESTIMATE)
32300 }
32301 WHEEL_DISTANCE_DATA::ID => {
32302 WHEEL_DISTANCE_DATA::deser(version, payload).map(Self::WHEEL_DISTANCE)
32303 }
32304 WIFI_CONFIG_AP_DATA::ID => {
32305 WIFI_CONFIG_AP_DATA::deser(version, payload).map(Self::WIFI_CONFIG_AP)
32306 }
32307 WINCH_STATUS_DATA::ID => {
32308 WINCH_STATUS_DATA::deser(version, payload).map(Self::WINCH_STATUS)
32309 }
32310 WIND_COV_DATA::ID => WIND_COV_DATA::deser(version, payload).map(Self::WIND_COV),
32311 _ => Err(::mavlink_core::error::ParserError::UnknownMessage { id }),
32312 }
32313 }
32314 fn message_name(&self) -> &'static str {
32315 match self {
32316 Self::ACTUATOR_CONTROL_TARGET(..) => ACTUATOR_CONTROL_TARGET_DATA::NAME,
32317 Self::ACTUATOR_OUTPUT_STATUS(..) => ACTUATOR_OUTPUT_STATUS_DATA::NAME,
32318 Self::ADSB_VEHICLE(..) => ADSB_VEHICLE_DATA::NAME,
32319 Self::AIS_VESSEL(..) => AIS_VESSEL_DATA::NAME,
32320 Self::ALTITUDE(..) => ALTITUDE_DATA::NAME,
32321 Self::ATTITUDE(..) => ATTITUDE_DATA::NAME,
32322 Self::ATTITUDE_QUATERNION(..) => ATTITUDE_QUATERNION_DATA::NAME,
32323 Self::ATTITUDE_QUATERNION_COV(..) => ATTITUDE_QUATERNION_COV_DATA::NAME,
32324 Self::ATTITUDE_TARGET(..) => ATTITUDE_TARGET_DATA::NAME,
32325 Self::ATT_POS_MOCAP(..) => ATT_POS_MOCAP_DATA::NAME,
32326 Self::AUTH_KEY(..) => AUTH_KEY_DATA::NAME,
32327 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(..) => {
32328 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::NAME
32329 }
32330 Self::AUTOPILOT_VERSION(..) => AUTOPILOT_VERSION_DATA::NAME,
32331 Self::AVAILABLE_MODES(..) => AVAILABLE_MODES_DATA::NAME,
32332 Self::AVAILABLE_MODES_MONITOR(..) => AVAILABLE_MODES_MONITOR_DATA::NAME,
32333 Self::BATTERY_INFO(..) => BATTERY_INFO_DATA::NAME,
32334 Self::BATTERY_STATUS(..) => BATTERY_STATUS_DATA::NAME,
32335 Self::BUTTON_CHANGE(..) => BUTTON_CHANGE_DATA::NAME,
32336 Self::CAMERA_CAPTURE_STATUS(..) => CAMERA_CAPTURE_STATUS_DATA::NAME,
32337 Self::CAMERA_FOV_STATUS(..) => CAMERA_FOV_STATUS_DATA::NAME,
32338 Self::CAMERA_IMAGE_CAPTURED(..) => CAMERA_IMAGE_CAPTURED_DATA::NAME,
32339 Self::CAMERA_INFORMATION(..) => CAMERA_INFORMATION_DATA::NAME,
32340 Self::CAMERA_SETTINGS(..) => CAMERA_SETTINGS_DATA::NAME,
32341 Self::CAMERA_THERMAL_RANGE(..) => CAMERA_THERMAL_RANGE_DATA::NAME,
32342 Self::CAMERA_TRACKING_GEO_STATUS(..) => CAMERA_TRACKING_GEO_STATUS_DATA::NAME,
32343 Self::CAMERA_TRACKING_IMAGE_STATUS(..) => CAMERA_TRACKING_IMAGE_STATUS_DATA::NAME,
32344 Self::CAMERA_TRIGGER(..) => CAMERA_TRIGGER_DATA::NAME,
32345 Self::CANFD_FRAME(..) => CANFD_FRAME_DATA::NAME,
32346 Self::CAN_FILTER_MODIFY(..) => CAN_FILTER_MODIFY_DATA::NAME,
32347 Self::CAN_FRAME(..) => CAN_FRAME_DATA::NAME,
32348 Self::CELLULAR_CONFIG(..) => CELLULAR_CONFIG_DATA::NAME,
32349 Self::CELLULAR_STATUS(..) => CELLULAR_STATUS_DATA::NAME,
32350 Self::CHANGE_OPERATOR_CONTROL(..) => CHANGE_OPERATOR_CONTROL_DATA::NAME,
32351 Self::CHANGE_OPERATOR_CONTROL_ACK(..) => CHANGE_OPERATOR_CONTROL_ACK_DATA::NAME,
32352 Self::COLLISION(..) => COLLISION_DATA::NAME,
32353 Self::COMMAND_ACK(..) => COMMAND_ACK_DATA::NAME,
32354 Self::COMMAND_CANCEL(..) => COMMAND_CANCEL_DATA::NAME,
32355 Self::COMMAND_INT(..) => COMMAND_INT_DATA::NAME,
32356 Self::COMMAND_LONG(..) => COMMAND_LONG_DATA::NAME,
32357 Self::COMPONENT_INFORMATION(..) => COMPONENT_INFORMATION_DATA::NAME,
32358 Self::COMPONENT_INFORMATION_BASIC(..) => COMPONENT_INFORMATION_BASIC_DATA::NAME,
32359 Self::COMPONENT_METADATA(..) => COMPONENT_METADATA_DATA::NAME,
32360 Self::CONTROL_SYSTEM_STATE(..) => CONTROL_SYSTEM_STATE_DATA::NAME,
32361 Self::CURRENT_EVENT_SEQUENCE(..) => CURRENT_EVENT_SEQUENCE_DATA::NAME,
32362 Self::CURRENT_MODE(..) => CURRENT_MODE_DATA::NAME,
32363 Self::DATA_STREAM(..) => DATA_STREAM_DATA::NAME,
32364 Self::DATA_TRANSMISSION_HANDSHAKE(..) => DATA_TRANSMISSION_HANDSHAKE_DATA::NAME,
32365 Self::DEBUG(..) => DEBUG_DATA::NAME,
32366 Self::DEBUG_FLOAT_ARRAY(..) => DEBUG_FLOAT_ARRAY_DATA::NAME,
32367 Self::DEBUG_VECT(..) => DEBUG_VECT_DATA::NAME,
32368 Self::DISTANCE_SENSOR(..) => DISTANCE_SENSOR_DATA::NAME,
32369 Self::EFI_STATUS(..) => EFI_STATUS_DATA::NAME,
32370 Self::ENCAPSULATED_DATA(..) => ENCAPSULATED_DATA_DATA::NAME,
32371 Self::ESC_INFO(..) => ESC_INFO_DATA::NAME,
32372 Self::ESC_STATUS(..) => ESC_STATUS_DATA::NAME,
32373 Self::ESTIMATOR_STATUS(..) => ESTIMATOR_STATUS_DATA::NAME,
32374 Self::EVENT(..) => EVENT_DATA::NAME,
32375 Self::EXTENDED_SYS_STATE(..) => EXTENDED_SYS_STATE_DATA::NAME,
32376 Self::FENCE_STATUS(..) => FENCE_STATUS_DATA::NAME,
32377 Self::FILE_TRANSFER_PROTOCOL(..) => FILE_TRANSFER_PROTOCOL_DATA::NAME,
32378 Self::FLIGHT_INFORMATION(..) => FLIGHT_INFORMATION_DATA::NAME,
32379 Self::FOLLOW_TARGET(..) => FOLLOW_TARGET_DATA::NAME,
32380 Self::FUEL_STATUS(..) => FUEL_STATUS_DATA::NAME,
32381 Self::GENERATOR_STATUS(..) => GENERATOR_STATUS_DATA::NAME,
32382 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(..) => GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::NAME,
32383 Self::GIMBAL_DEVICE_INFORMATION(..) => GIMBAL_DEVICE_INFORMATION_DATA::NAME,
32384 Self::GIMBAL_DEVICE_SET_ATTITUDE(..) => GIMBAL_DEVICE_SET_ATTITUDE_DATA::NAME,
32385 Self::GIMBAL_MANAGER_INFORMATION(..) => GIMBAL_MANAGER_INFORMATION_DATA::NAME,
32386 Self::GIMBAL_MANAGER_SET_ATTITUDE(..) => GIMBAL_MANAGER_SET_ATTITUDE_DATA::NAME,
32387 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(..) => {
32388 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::NAME
32389 }
32390 Self::GIMBAL_MANAGER_SET_PITCHYAW(..) => GIMBAL_MANAGER_SET_PITCHYAW_DATA::NAME,
32391 Self::GIMBAL_MANAGER_STATUS(..) => GIMBAL_MANAGER_STATUS_DATA::NAME,
32392 Self::GLOBAL_POSITION_INT(..) => GLOBAL_POSITION_INT_DATA::NAME,
32393 Self::GLOBAL_POSITION_INT_COV(..) => GLOBAL_POSITION_INT_COV_DATA::NAME,
32394 Self::GLOBAL_VISION_POSITION_ESTIMATE(..) => GLOBAL_VISION_POSITION_ESTIMATE_DATA::NAME,
32395 Self::GPS2_RAW(..) => GPS2_RAW_DATA::NAME,
32396 Self::GPS2_RTK(..) => GPS2_RTK_DATA::NAME,
32397 Self::GPS_GLOBAL_ORIGIN(..) => GPS_GLOBAL_ORIGIN_DATA::NAME,
32398 Self::GPS_INJECT_DATA(..) => GPS_INJECT_DATA_DATA::NAME,
32399 Self::GPS_INPUT(..) => GPS_INPUT_DATA::NAME,
32400 Self::GPS_RAW_INT(..) => GPS_RAW_INT_DATA::NAME,
32401 Self::GPS_RTCM_DATA(..) => GPS_RTCM_DATA_DATA::NAME,
32402 Self::GPS_RTK(..) => GPS_RTK_DATA::NAME,
32403 Self::GPS_STATUS(..) => GPS_STATUS_DATA::NAME,
32404 Self::HEARTBEAT(..) => HEARTBEAT_DATA::NAME,
32405 Self::HIGHRES_IMU(..) => HIGHRES_IMU_DATA::NAME,
32406 Self::HIGH_LATENCY(..) => HIGH_LATENCY_DATA::NAME,
32407 Self::HIGH_LATENCY2(..) => HIGH_LATENCY2_DATA::NAME,
32408 Self::HIL_ACTUATOR_CONTROLS(..) => HIL_ACTUATOR_CONTROLS_DATA::NAME,
32409 Self::HIL_CONTROLS(..) => HIL_CONTROLS_DATA::NAME,
32410 Self::HIL_GPS(..) => HIL_GPS_DATA::NAME,
32411 Self::HIL_OPTICAL_FLOW(..) => HIL_OPTICAL_FLOW_DATA::NAME,
32412 Self::HIL_RC_INPUTS_RAW(..) => HIL_RC_INPUTS_RAW_DATA::NAME,
32413 Self::HIL_SENSOR(..) => HIL_SENSOR_DATA::NAME,
32414 Self::HIL_STATE(..) => HIL_STATE_DATA::NAME,
32415 Self::HIL_STATE_QUATERNION(..) => HIL_STATE_QUATERNION_DATA::NAME,
32416 Self::HOME_POSITION(..) => HOME_POSITION_DATA::NAME,
32417 Self::HYGROMETER_SENSOR(..) => HYGROMETER_SENSOR_DATA::NAME,
32418 Self::ILLUMINATOR_STATUS(..) => ILLUMINATOR_STATUS_DATA::NAME,
32419 Self::ISBD_LINK_STATUS(..) => ISBD_LINK_STATUS_DATA::NAME,
32420 Self::LANDING_TARGET(..) => LANDING_TARGET_DATA::NAME,
32421 Self::LINK_NODE_STATUS(..) => LINK_NODE_STATUS_DATA::NAME,
32422 Self::LOCAL_POSITION_NED(..) => LOCAL_POSITION_NED_DATA::NAME,
32423 Self::LOCAL_POSITION_NED_COV(..) => LOCAL_POSITION_NED_COV_DATA::NAME,
32424 Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(..) => {
32425 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::NAME
32426 }
32427 Self::LOGGING_ACK(..) => LOGGING_ACK_DATA::NAME,
32428 Self::LOGGING_DATA(..) => LOGGING_DATA_DATA::NAME,
32429 Self::LOGGING_DATA_ACKED(..) => LOGGING_DATA_ACKED_DATA::NAME,
32430 Self::LOG_DATA(..) => LOG_DATA_DATA::NAME,
32431 Self::LOG_ENTRY(..) => LOG_ENTRY_DATA::NAME,
32432 Self::LOG_ERASE(..) => LOG_ERASE_DATA::NAME,
32433 Self::LOG_REQUEST_DATA(..) => LOG_REQUEST_DATA_DATA::NAME,
32434 Self::LOG_REQUEST_END(..) => LOG_REQUEST_END_DATA::NAME,
32435 Self::LOG_REQUEST_LIST(..) => LOG_REQUEST_LIST_DATA::NAME,
32436 Self::MAG_CAL_REPORT(..) => MAG_CAL_REPORT_DATA::NAME,
32437 Self::MANUAL_CONTROL(..) => MANUAL_CONTROL_DATA::NAME,
32438 Self::MANUAL_SETPOINT(..) => MANUAL_SETPOINT_DATA::NAME,
32439 Self::MEMORY_VECT(..) => MEMORY_VECT_DATA::NAME,
32440 Self::MESSAGE_INTERVAL(..) => MESSAGE_INTERVAL_DATA::NAME,
32441 Self::MISSION_ACK(..) => MISSION_ACK_DATA::NAME,
32442 Self::MISSION_CLEAR_ALL(..) => MISSION_CLEAR_ALL_DATA::NAME,
32443 Self::MISSION_COUNT(..) => MISSION_COUNT_DATA::NAME,
32444 Self::MISSION_CURRENT(..) => MISSION_CURRENT_DATA::NAME,
32445 Self::MISSION_ITEM(..) => MISSION_ITEM_DATA::NAME,
32446 Self::MISSION_ITEM_INT(..) => MISSION_ITEM_INT_DATA::NAME,
32447 Self::MISSION_ITEM_REACHED(..) => MISSION_ITEM_REACHED_DATA::NAME,
32448 Self::MISSION_REQUEST(..) => MISSION_REQUEST_DATA::NAME,
32449 Self::MISSION_REQUEST_INT(..) => MISSION_REQUEST_INT_DATA::NAME,
32450 Self::MISSION_REQUEST_LIST(..) => MISSION_REQUEST_LIST_DATA::NAME,
32451 Self::MISSION_REQUEST_PARTIAL_LIST(..) => MISSION_REQUEST_PARTIAL_LIST_DATA::NAME,
32452 Self::MISSION_SET_CURRENT(..) => MISSION_SET_CURRENT_DATA::NAME,
32453 Self::MISSION_WRITE_PARTIAL_LIST(..) => MISSION_WRITE_PARTIAL_LIST_DATA::NAME,
32454 Self::MOUNT_ORIENTATION(..) => MOUNT_ORIENTATION_DATA::NAME,
32455 Self::NAMED_VALUE_FLOAT(..) => NAMED_VALUE_FLOAT_DATA::NAME,
32456 Self::NAMED_VALUE_INT(..) => NAMED_VALUE_INT_DATA::NAME,
32457 Self::NAV_CONTROLLER_OUTPUT(..) => NAV_CONTROLLER_OUTPUT_DATA::NAME,
32458 Self::OBSTACLE_DISTANCE(..) => OBSTACLE_DISTANCE_DATA::NAME,
32459 Self::ODOMETRY(..) => ODOMETRY_DATA::NAME,
32460 Self::ONBOARD_COMPUTER_STATUS(..) => ONBOARD_COMPUTER_STATUS_DATA::NAME,
32461 Self::OPEN_DRONE_ID_ARM_STATUS(..) => OPEN_DRONE_ID_ARM_STATUS_DATA::NAME,
32462 Self::OPEN_DRONE_ID_AUTHENTICATION(..) => OPEN_DRONE_ID_AUTHENTICATION_DATA::NAME,
32463 Self::OPEN_DRONE_ID_BASIC_ID(..) => OPEN_DRONE_ID_BASIC_ID_DATA::NAME,
32464 Self::OPEN_DRONE_ID_LOCATION(..) => OPEN_DRONE_ID_LOCATION_DATA::NAME,
32465 Self::OPEN_DRONE_ID_MESSAGE_PACK(..) => OPEN_DRONE_ID_MESSAGE_PACK_DATA::NAME,
32466 Self::OPEN_DRONE_ID_OPERATOR_ID(..) => OPEN_DRONE_ID_OPERATOR_ID_DATA::NAME,
32467 Self::OPEN_DRONE_ID_SELF_ID(..) => OPEN_DRONE_ID_SELF_ID_DATA::NAME,
32468 Self::OPEN_DRONE_ID_SYSTEM(..) => OPEN_DRONE_ID_SYSTEM_DATA::NAME,
32469 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(..) => OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::NAME,
32470 Self::OPTICAL_FLOW(..) => OPTICAL_FLOW_DATA::NAME,
32471 Self::OPTICAL_FLOW_RAD(..) => OPTICAL_FLOW_RAD_DATA::NAME,
32472 Self::ORBIT_EXECUTION_STATUS(..) => ORBIT_EXECUTION_STATUS_DATA::NAME,
32473 Self::PARAM_EXT_ACK(..) => PARAM_EXT_ACK_DATA::NAME,
32474 Self::PARAM_EXT_REQUEST_LIST(..) => PARAM_EXT_REQUEST_LIST_DATA::NAME,
32475 Self::PARAM_EXT_REQUEST_READ(..) => PARAM_EXT_REQUEST_READ_DATA::NAME,
32476 Self::PARAM_EXT_SET(..) => PARAM_EXT_SET_DATA::NAME,
32477 Self::PARAM_EXT_VALUE(..) => PARAM_EXT_VALUE_DATA::NAME,
32478 Self::PARAM_MAP_RC(..) => PARAM_MAP_RC_DATA::NAME,
32479 Self::PARAM_REQUEST_LIST(..) => PARAM_REQUEST_LIST_DATA::NAME,
32480 Self::PARAM_REQUEST_READ(..) => PARAM_REQUEST_READ_DATA::NAME,
32481 Self::PARAM_SET(..) => PARAM_SET_DATA::NAME,
32482 Self::PARAM_VALUE(..) => PARAM_VALUE_DATA::NAME,
32483 Self::PING(..) => PING_DATA::NAME,
32484 Self::PLAY_TUNE(..) => PLAY_TUNE_DATA::NAME,
32485 Self::PLAY_TUNE_V2(..) => PLAY_TUNE_V2_DATA::NAME,
32486 Self::POSITION_TARGET_GLOBAL_INT(..) => POSITION_TARGET_GLOBAL_INT_DATA::NAME,
32487 Self::POSITION_TARGET_LOCAL_NED(..) => POSITION_TARGET_LOCAL_NED_DATA::NAME,
32488 Self::POWER_STATUS(..) => POWER_STATUS_DATA::NAME,
32489 Self::PROTOCOL_VERSION(..) => PROTOCOL_VERSION_DATA::NAME,
32490 Self::RADIO_STATUS(..) => RADIO_STATUS_DATA::NAME,
32491 Self::RAW_IMU(..) => RAW_IMU_DATA::NAME,
32492 Self::RAW_PRESSURE(..) => RAW_PRESSURE_DATA::NAME,
32493 Self::RAW_RPM(..) => RAW_RPM_DATA::NAME,
32494 Self::RC_CHANNELS(..) => RC_CHANNELS_DATA::NAME,
32495 Self::RC_CHANNELS_OVERRIDE(..) => RC_CHANNELS_OVERRIDE_DATA::NAME,
32496 Self::RC_CHANNELS_RAW(..) => RC_CHANNELS_RAW_DATA::NAME,
32497 Self::RC_CHANNELS_SCALED(..) => RC_CHANNELS_SCALED_DATA::NAME,
32498 Self::REQUEST_DATA_STREAM(..) => REQUEST_DATA_STREAM_DATA::NAME,
32499 Self::REQUEST_EVENT(..) => REQUEST_EVENT_DATA::NAME,
32500 Self::RESOURCE_REQUEST(..) => RESOURCE_REQUEST_DATA::NAME,
32501 Self::RESPONSE_EVENT_ERROR(..) => RESPONSE_EVENT_ERROR_DATA::NAME,
32502 Self::SAFETY_ALLOWED_AREA(..) => SAFETY_ALLOWED_AREA_DATA::NAME,
32503 Self::SAFETY_SET_ALLOWED_AREA(..) => SAFETY_SET_ALLOWED_AREA_DATA::NAME,
32504 Self::SCALED_IMU(..) => SCALED_IMU_DATA::NAME,
32505 Self::SCALED_IMU2(..) => SCALED_IMU2_DATA::NAME,
32506 Self::SCALED_IMU3(..) => SCALED_IMU3_DATA::NAME,
32507 Self::SCALED_PRESSURE(..) => SCALED_PRESSURE_DATA::NAME,
32508 Self::SCALED_PRESSURE2(..) => SCALED_PRESSURE2_DATA::NAME,
32509 Self::SCALED_PRESSURE3(..) => SCALED_PRESSURE3_DATA::NAME,
32510 Self::SCRIPT_COUNT(..) => SCRIPT_COUNT_DATA::NAME,
32511 Self::SCRIPT_CURRENT(..) => SCRIPT_CURRENT_DATA::NAME,
32512 Self::SCRIPT_ITEM(..) => SCRIPT_ITEM_DATA::NAME,
32513 Self::SCRIPT_REQUEST(..) => SCRIPT_REQUEST_DATA::NAME,
32514 Self::SCRIPT_REQUEST_LIST(..) => SCRIPT_REQUEST_LIST_DATA::NAME,
32515 Self::SERIAL_CONTROL(..) => SERIAL_CONTROL_DATA::NAME,
32516 Self::SERVO_OUTPUT_RAW(..) => SERVO_OUTPUT_RAW_DATA::NAME,
32517 Self::SETUP_SIGNING(..) => SETUP_SIGNING_DATA::NAME,
32518 Self::SET_ACTUATOR_CONTROL_TARGET(..) => SET_ACTUATOR_CONTROL_TARGET_DATA::NAME,
32519 Self::SET_ATTITUDE_TARGET(..) => SET_ATTITUDE_TARGET_DATA::NAME,
32520 Self::SET_GPS_GLOBAL_ORIGIN(..) => SET_GPS_GLOBAL_ORIGIN_DATA::NAME,
32521 Self::SET_HOME_POSITION(..) => SET_HOME_POSITION_DATA::NAME,
32522 Self::SET_MODE(..) => SET_MODE_DATA::NAME,
32523 Self::SET_POSITION_TARGET_GLOBAL_INT(..) => SET_POSITION_TARGET_GLOBAL_INT_DATA::NAME,
32524 Self::SET_POSITION_TARGET_LOCAL_NED(..) => SET_POSITION_TARGET_LOCAL_NED_DATA::NAME,
32525 Self::SIM_STATE(..) => SIM_STATE_DATA::NAME,
32526 Self::SMART_BATTERY_INFO(..) => SMART_BATTERY_INFO_DATA::NAME,
32527 Self::STATUSTEXT(..) => STATUSTEXT_DATA::NAME,
32528 Self::STORAGE_INFORMATION(..) => STORAGE_INFORMATION_DATA::NAME,
32529 Self::SUPPORTED_TUNES(..) => SUPPORTED_TUNES_DATA::NAME,
32530 Self::SYSTEM_TIME(..) => SYSTEM_TIME_DATA::NAME,
32531 Self::SYS_STATUS(..) => SYS_STATUS_DATA::NAME,
32532 Self::TERRAIN_CHECK(..) => TERRAIN_CHECK_DATA::NAME,
32533 Self::TERRAIN_DATA(..) => TERRAIN_DATA_DATA::NAME,
32534 Self::TERRAIN_REPORT(..) => TERRAIN_REPORT_DATA::NAME,
32535 Self::TERRAIN_REQUEST(..) => TERRAIN_REQUEST_DATA::NAME,
32536 Self::TIMESYNC(..) => TIMESYNC_DATA::NAME,
32537 Self::TIME_ESTIMATE_TO_TARGET(..) => TIME_ESTIMATE_TO_TARGET_DATA::NAME,
32538 Self::TRAJECTORY_REPRESENTATION_BEZIER(..) => {
32539 TRAJECTORY_REPRESENTATION_BEZIER_DATA::NAME
32540 }
32541 Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(..) => {
32542 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::NAME
32543 }
32544 Self::TUNNEL(..) => TUNNEL_DATA::NAME,
32545 Self::UAVCAN_NODE_INFO(..) => UAVCAN_NODE_INFO_DATA::NAME,
32546 Self::UAVCAN_NODE_STATUS(..) => UAVCAN_NODE_STATUS_DATA::NAME,
32547 Self::UTM_GLOBAL_POSITION(..) => UTM_GLOBAL_POSITION_DATA::NAME,
32548 Self::V2_EXTENSION(..) => V2_EXTENSION_DATA::NAME,
32549 Self::VFR_HUD(..) => VFR_HUD_DATA::NAME,
32550 Self::VIBRATION(..) => VIBRATION_DATA::NAME,
32551 Self::VICON_POSITION_ESTIMATE(..) => VICON_POSITION_ESTIMATE_DATA::NAME,
32552 Self::VIDEO_STREAM_INFORMATION(..) => VIDEO_STREAM_INFORMATION_DATA::NAME,
32553 Self::VIDEO_STREAM_STATUS(..) => VIDEO_STREAM_STATUS_DATA::NAME,
32554 Self::VISION_POSITION_ESTIMATE(..) => VISION_POSITION_ESTIMATE_DATA::NAME,
32555 Self::VISION_SPEED_ESTIMATE(..) => VISION_SPEED_ESTIMATE_DATA::NAME,
32556 Self::WHEEL_DISTANCE(..) => WHEEL_DISTANCE_DATA::NAME,
32557 Self::WIFI_CONFIG_AP(..) => WIFI_CONFIG_AP_DATA::NAME,
32558 Self::WINCH_STATUS(..) => WINCH_STATUS_DATA::NAME,
32559 Self::WIND_COV(..) => WIND_COV_DATA::NAME,
32560 }
32561 }
32562 fn message_id(&self) -> u32 {
32563 match self {
32564 Self::ACTUATOR_CONTROL_TARGET(..) => ACTUATOR_CONTROL_TARGET_DATA::ID,
32565 Self::ACTUATOR_OUTPUT_STATUS(..) => ACTUATOR_OUTPUT_STATUS_DATA::ID,
32566 Self::ADSB_VEHICLE(..) => ADSB_VEHICLE_DATA::ID,
32567 Self::AIS_VESSEL(..) => AIS_VESSEL_DATA::ID,
32568 Self::ALTITUDE(..) => ALTITUDE_DATA::ID,
32569 Self::ATTITUDE(..) => ATTITUDE_DATA::ID,
32570 Self::ATTITUDE_QUATERNION(..) => ATTITUDE_QUATERNION_DATA::ID,
32571 Self::ATTITUDE_QUATERNION_COV(..) => ATTITUDE_QUATERNION_COV_DATA::ID,
32572 Self::ATTITUDE_TARGET(..) => ATTITUDE_TARGET_DATA::ID,
32573 Self::ATT_POS_MOCAP(..) => ATT_POS_MOCAP_DATA::ID,
32574 Self::AUTH_KEY(..) => AUTH_KEY_DATA::ID,
32575 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(..) => {
32576 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID
32577 }
32578 Self::AUTOPILOT_VERSION(..) => AUTOPILOT_VERSION_DATA::ID,
32579 Self::AVAILABLE_MODES(..) => AVAILABLE_MODES_DATA::ID,
32580 Self::AVAILABLE_MODES_MONITOR(..) => AVAILABLE_MODES_MONITOR_DATA::ID,
32581 Self::BATTERY_INFO(..) => BATTERY_INFO_DATA::ID,
32582 Self::BATTERY_STATUS(..) => BATTERY_STATUS_DATA::ID,
32583 Self::BUTTON_CHANGE(..) => BUTTON_CHANGE_DATA::ID,
32584 Self::CAMERA_CAPTURE_STATUS(..) => CAMERA_CAPTURE_STATUS_DATA::ID,
32585 Self::CAMERA_FOV_STATUS(..) => CAMERA_FOV_STATUS_DATA::ID,
32586 Self::CAMERA_IMAGE_CAPTURED(..) => CAMERA_IMAGE_CAPTURED_DATA::ID,
32587 Self::CAMERA_INFORMATION(..) => CAMERA_INFORMATION_DATA::ID,
32588 Self::CAMERA_SETTINGS(..) => CAMERA_SETTINGS_DATA::ID,
32589 Self::CAMERA_THERMAL_RANGE(..) => CAMERA_THERMAL_RANGE_DATA::ID,
32590 Self::CAMERA_TRACKING_GEO_STATUS(..) => CAMERA_TRACKING_GEO_STATUS_DATA::ID,
32591 Self::CAMERA_TRACKING_IMAGE_STATUS(..) => CAMERA_TRACKING_IMAGE_STATUS_DATA::ID,
32592 Self::CAMERA_TRIGGER(..) => CAMERA_TRIGGER_DATA::ID,
32593 Self::CANFD_FRAME(..) => CANFD_FRAME_DATA::ID,
32594 Self::CAN_FILTER_MODIFY(..) => CAN_FILTER_MODIFY_DATA::ID,
32595 Self::CAN_FRAME(..) => CAN_FRAME_DATA::ID,
32596 Self::CELLULAR_CONFIG(..) => CELLULAR_CONFIG_DATA::ID,
32597 Self::CELLULAR_STATUS(..) => CELLULAR_STATUS_DATA::ID,
32598 Self::CHANGE_OPERATOR_CONTROL(..) => CHANGE_OPERATOR_CONTROL_DATA::ID,
32599 Self::CHANGE_OPERATOR_CONTROL_ACK(..) => CHANGE_OPERATOR_CONTROL_ACK_DATA::ID,
32600 Self::COLLISION(..) => COLLISION_DATA::ID,
32601 Self::COMMAND_ACK(..) => COMMAND_ACK_DATA::ID,
32602 Self::COMMAND_CANCEL(..) => COMMAND_CANCEL_DATA::ID,
32603 Self::COMMAND_INT(..) => COMMAND_INT_DATA::ID,
32604 Self::COMMAND_LONG(..) => COMMAND_LONG_DATA::ID,
32605 Self::COMPONENT_INFORMATION(..) => COMPONENT_INFORMATION_DATA::ID,
32606 Self::COMPONENT_INFORMATION_BASIC(..) => COMPONENT_INFORMATION_BASIC_DATA::ID,
32607 Self::COMPONENT_METADATA(..) => COMPONENT_METADATA_DATA::ID,
32608 Self::CONTROL_SYSTEM_STATE(..) => CONTROL_SYSTEM_STATE_DATA::ID,
32609 Self::CURRENT_EVENT_SEQUENCE(..) => CURRENT_EVENT_SEQUENCE_DATA::ID,
32610 Self::CURRENT_MODE(..) => CURRENT_MODE_DATA::ID,
32611 Self::DATA_STREAM(..) => DATA_STREAM_DATA::ID,
32612 Self::DATA_TRANSMISSION_HANDSHAKE(..) => DATA_TRANSMISSION_HANDSHAKE_DATA::ID,
32613 Self::DEBUG(..) => DEBUG_DATA::ID,
32614 Self::DEBUG_FLOAT_ARRAY(..) => DEBUG_FLOAT_ARRAY_DATA::ID,
32615 Self::DEBUG_VECT(..) => DEBUG_VECT_DATA::ID,
32616 Self::DISTANCE_SENSOR(..) => DISTANCE_SENSOR_DATA::ID,
32617 Self::EFI_STATUS(..) => EFI_STATUS_DATA::ID,
32618 Self::ENCAPSULATED_DATA(..) => ENCAPSULATED_DATA_DATA::ID,
32619 Self::ESC_INFO(..) => ESC_INFO_DATA::ID,
32620 Self::ESC_STATUS(..) => ESC_STATUS_DATA::ID,
32621 Self::ESTIMATOR_STATUS(..) => ESTIMATOR_STATUS_DATA::ID,
32622 Self::EVENT(..) => EVENT_DATA::ID,
32623 Self::EXTENDED_SYS_STATE(..) => EXTENDED_SYS_STATE_DATA::ID,
32624 Self::FENCE_STATUS(..) => FENCE_STATUS_DATA::ID,
32625 Self::FILE_TRANSFER_PROTOCOL(..) => FILE_TRANSFER_PROTOCOL_DATA::ID,
32626 Self::FLIGHT_INFORMATION(..) => FLIGHT_INFORMATION_DATA::ID,
32627 Self::FOLLOW_TARGET(..) => FOLLOW_TARGET_DATA::ID,
32628 Self::FUEL_STATUS(..) => FUEL_STATUS_DATA::ID,
32629 Self::GENERATOR_STATUS(..) => GENERATOR_STATUS_DATA::ID,
32630 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(..) => GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID,
32631 Self::GIMBAL_DEVICE_INFORMATION(..) => GIMBAL_DEVICE_INFORMATION_DATA::ID,
32632 Self::GIMBAL_DEVICE_SET_ATTITUDE(..) => GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID,
32633 Self::GIMBAL_MANAGER_INFORMATION(..) => GIMBAL_MANAGER_INFORMATION_DATA::ID,
32634 Self::GIMBAL_MANAGER_SET_ATTITUDE(..) => GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID,
32635 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(..) => {
32636 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID
32637 }
32638 Self::GIMBAL_MANAGER_SET_PITCHYAW(..) => GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID,
32639 Self::GIMBAL_MANAGER_STATUS(..) => GIMBAL_MANAGER_STATUS_DATA::ID,
32640 Self::GLOBAL_POSITION_INT(..) => GLOBAL_POSITION_INT_DATA::ID,
32641 Self::GLOBAL_POSITION_INT_COV(..) => GLOBAL_POSITION_INT_COV_DATA::ID,
32642 Self::GLOBAL_VISION_POSITION_ESTIMATE(..) => GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID,
32643 Self::GPS2_RAW(..) => GPS2_RAW_DATA::ID,
32644 Self::GPS2_RTK(..) => GPS2_RTK_DATA::ID,
32645 Self::GPS_GLOBAL_ORIGIN(..) => GPS_GLOBAL_ORIGIN_DATA::ID,
32646 Self::GPS_INJECT_DATA(..) => GPS_INJECT_DATA_DATA::ID,
32647 Self::GPS_INPUT(..) => GPS_INPUT_DATA::ID,
32648 Self::GPS_RAW_INT(..) => GPS_RAW_INT_DATA::ID,
32649 Self::GPS_RTCM_DATA(..) => GPS_RTCM_DATA_DATA::ID,
32650 Self::GPS_RTK(..) => GPS_RTK_DATA::ID,
32651 Self::GPS_STATUS(..) => GPS_STATUS_DATA::ID,
32652 Self::HEARTBEAT(..) => HEARTBEAT_DATA::ID,
32653 Self::HIGHRES_IMU(..) => HIGHRES_IMU_DATA::ID,
32654 Self::HIGH_LATENCY(..) => HIGH_LATENCY_DATA::ID,
32655 Self::HIGH_LATENCY2(..) => HIGH_LATENCY2_DATA::ID,
32656 Self::HIL_ACTUATOR_CONTROLS(..) => HIL_ACTUATOR_CONTROLS_DATA::ID,
32657 Self::HIL_CONTROLS(..) => HIL_CONTROLS_DATA::ID,
32658 Self::HIL_GPS(..) => HIL_GPS_DATA::ID,
32659 Self::HIL_OPTICAL_FLOW(..) => HIL_OPTICAL_FLOW_DATA::ID,
32660 Self::HIL_RC_INPUTS_RAW(..) => HIL_RC_INPUTS_RAW_DATA::ID,
32661 Self::HIL_SENSOR(..) => HIL_SENSOR_DATA::ID,
32662 Self::HIL_STATE(..) => HIL_STATE_DATA::ID,
32663 Self::HIL_STATE_QUATERNION(..) => HIL_STATE_QUATERNION_DATA::ID,
32664 Self::HOME_POSITION(..) => HOME_POSITION_DATA::ID,
32665 Self::HYGROMETER_SENSOR(..) => HYGROMETER_SENSOR_DATA::ID,
32666 Self::ILLUMINATOR_STATUS(..) => ILLUMINATOR_STATUS_DATA::ID,
32667 Self::ISBD_LINK_STATUS(..) => ISBD_LINK_STATUS_DATA::ID,
32668 Self::LANDING_TARGET(..) => LANDING_TARGET_DATA::ID,
32669 Self::LINK_NODE_STATUS(..) => LINK_NODE_STATUS_DATA::ID,
32670 Self::LOCAL_POSITION_NED(..) => LOCAL_POSITION_NED_DATA::ID,
32671 Self::LOCAL_POSITION_NED_COV(..) => LOCAL_POSITION_NED_COV_DATA::ID,
32672 Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(..) => {
32673 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID
32674 }
32675 Self::LOGGING_ACK(..) => LOGGING_ACK_DATA::ID,
32676 Self::LOGGING_DATA(..) => LOGGING_DATA_DATA::ID,
32677 Self::LOGGING_DATA_ACKED(..) => LOGGING_DATA_ACKED_DATA::ID,
32678 Self::LOG_DATA(..) => LOG_DATA_DATA::ID,
32679 Self::LOG_ENTRY(..) => LOG_ENTRY_DATA::ID,
32680 Self::LOG_ERASE(..) => LOG_ERASE_DATA::ID,
32681 Self::LOG_REQUEST_DATA(..) => LOG_REQUEST_DATA_DATA::ID,
32682 Self::LOG_REQUEST_END(..) => LOG_REQUEST_END_DATA::ID,
32683 Self::LOG_REQUEST_LIST(..) => LOG_REQUEST_LIST_DATA::ID,
32684 Self::MAG_CAL_REPORT(..) => MAG_CAL_REPORT_DATA::ID,
32685 Self::MANUAL_CONTROL(..) => MANUAL_CONTROL_DATA::ID,
32686 Self::MANUAL_SETPOINT(..) => MANUAL_SETPOINT_DATA::ID,
32687 Self::MEMORY_VECT(..) => MEMORY_VECT_DATA::ID,
32688 Self::MESSAGE_INTERVAL(..) => MESSAGE_INTERVAL_DATA::ID,
32689 Self::MISSION_ACK(..) => MISSION_ACK_DATA::ID,
32690 Self::MISSION_CLEAR_ALL(..) => MISSION_CLEAR_ALL_DATA::ID,
32691 Self::MISSION_COUNT(..) => MISSION_COUNT_DATA::ID,
32692 Self::MISSION_CURRENT(..) => MISSION_CURRENT_DATA::ID,
32693 Self::MISSION_ITEM(..) => MISSION_ITEM_DATA::ID,
32694 Self::MISSION_ITEM_INT(..) => MISSION_ITEM_INT_DATA::ID,
32695 Self::MISSION_ITEM_REACHED(..) => MISSION_ITEM_REACHED_DATA::ID,
32696 Self::MISSION_REQUEST(..) => MISSION_REQUEST_DATA::ID,
32697 Self::MISSION_REQUEST_INT(..) => MISSION_REQUEST_INT_DATA::ID,
32698 Self::MISSION_REQUEST_LIST(..) => MISSION_REQUEST_LIST_DATA::ID,
32699 Self::MISSION_REQUEST_PARTIAL_LIST(..) => MISSION_REQUEST_PARTIAL_LIST_DATA::ID,
32700 Self::MISSION_SET_CURRENT(..) => MISSION_SET_CURRENT_DATA::ID,
32701 Self::MISSION_WRITE_PARTIAL_LIST(..) => MISSION_WRITE_PARTIAL_LIST_DATA::ID,
32702 Self::MOUNT_ORIENTATION(..) => MOUNT_ORIENTATION_DATA::ID,
32703 Self::NAMED_VALUE_FLOAT(..) => NAMED_VALUE_FLOAT_DATA::ID,
32704 Self::NAMED_VALUE_INT(..) => NAMED_VALUE_INT_DATA::ID,
32705 Self::NAV_CONTROLLER_OUTPUT(..) => NAV_CONTROLLER_OUTPUT_DATA::ID,
32706 Self::OBSTACLE_DISTANCE(..) => OBSTACLE_DISTANCE_DATA::ID,
32707 Self::ODOMETRY(..) => ODOMETRY_DATA::ID,
32708 Self::ONBOARD_COMPUTER_STATUS(..) => ONBOARD_COMPUTER_STATUS_DATA::ID,
32709 Self::OPEN_DRONE_ID_ARM_STATUS(..) => OPEN_DRONE_ID_ARM_STATUS_DATA::ID,
32710 Self::OPEN_DRONE_ID_AUTHENTICATION(..) => OPEN_DRONE_ID_AUTHENTICATION_DATA::ID,
32711 Self::OPEN_DRONE_ID_BASIC_ID(..) => OPEN_DRONE_ID_BASIC_ID_DATA::ID,
32712 Self::OPEN_DRONE_ID_LOCATION(..) => OPEN_DRONE_ID_LOCATION_DATA::ID,
32713 Self::OPEN_DRONE_ID_MESSAGE_PACK(..) => OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID,
32714 Self::OPEN_DRONE_ID_OPERATOR_ID(..) => OPEN_DRONE_ID_OPERATOR_ID_DATA::ID,
32715 Self::OPEN_DRONE_ID_SELF_ID(..) => OPEN_DRONE_ID_SELF_ID_DATA::ID,
32716 Self::OPEN_DRONE_ID_SYSTEM(..) => OPEN_DRONE_ID_SYSTEM_DATA::ID,
32717 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(..) => OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID,
32718 Self::OPTICAL_FLOW(..) => OPTICAL_FLOW_DATA::ID,
32719 Self::OPTICAL_FLOW_RAD(..) => OPTICAL_FLOW_RAD_DATA::ID,
32720 Self::ORBIT_EXECUTION_STATUS(..) => ORBIT_EXECUTION_STATUS_DATA::ID,
32721 Self::PARAM_EXT_ACK(..) => PARAM_EXT_ACK_DATA::ID,
32722 Self::PARAM_EXT_REQUEST_LIST(..) => PARAM_EXT_REQUEST_LIST_DATA::ID,
32723 Self::PARAM_EXT_REQUEST_READ(..) => PARAM_EXT_REQUEST_READ_DATA::ID,
32724 Self::PARAM_EXT_SET(..) => PARAM_EXT_SET_DATA::ID,
32725 Self::PARAM_EXT_VALUE(..) => PARAM_EXT_VALUE_DATA::ID,
32726 Self::PARAM_MAP_RC(..) => PARAM_MAP_RC_DATA::ID,
32727 Self::PARAM_REQUEST_LIST(..) => PARAM_REQUEST_LIST_DATA::ID,
32728 Self::PARAM_REQUEST_READ(..) => PARAM_REQUEST_READ_DATA::ID,
32729 Self::PARAM_SET(..) => PARAM_SET_DATA::ID,
32730 Self::PARAM_VALUE(..) => PARAM_VALUE_DATA::ID,
32731 Self::PING(..) => PING_DATA::ID,
32732 Self::PLAY_TUNE(..) => PLAY_TUNE_DATA::ID,
32733 Self::PLAY_TUNE_V2(..) => PLAY_TUNE_V2_DATA::ID,
32734 Self::POSITION_TARGET_GLOBAL_INT(..) => POSITION_TARGET_GLOBAL_INT_DATA::ID,
32735 Self::POSITION_TARGET_LOCAL_NED(..) => POSITION_TARGET_LOCAL_NED_DATA::ID,
32736 Self::POWER_STATUS(..) => POWER_STATUS_DATA::ID,
32737 Self::PROTOCOL_VERSION(..) => PROTOCOL_VERSION_DATA::ID,
32738 Self::RADIO_STATUS(..) => RADIO_STATUS_DATA::ID,
32739 Self::RAW_IMU(..) => RAW_IMU_DATA::ID,
32740 Self::RAW_PRESSURE(..) => RAW_PRESSURE_DATA::ID,
32741 Self::RAW_RPM(..) => RAW_RPM_DATA::ID,
32742 Self::RC_CHANNELS(..) => RC_CHANNELS_DATA::ID,
32743 Self::RC_CHANNELS_OVERRIDE(..) => RC_CHANNELS_OVERRIDE_DATA::ID,
32744 Self::RC_CHANNELS_RAW(..) => RC_CHANNELS_RAW_DATA::ID,
32745 Self::RC_CHANNELS_SCALED(..) => RC_CHANNELS_SCALED_DATA::ID,
32746 Self::REQUEST_DATA_STREAM(..) => REQUEST_DATA_STREAM_DATA::ID,
32747 Self::REQUEST_EVENT(..) => REQUEST_EVENT_DATA::ID,
32748 Self::RESOURCE_REQUEST(..) => RESOURCE_REQUEST_DATA::ID,
32749 Self::RESPONSE_EVENT_ERROR(..) => RESPONSE_EVENT_ERROR_DATA::ID,
32750 Self::SAFETY_ALLOWED_AREA(..) => SAFETY_ALLOWED_AREA_DATA::ID,
32751 Self::SAFETY_SET_ALLOWED_AREA(..) => SAFETY_SET_ALLOWED_AREA_DATA::ID,
32752 Self::SCALED_IMU(..) => SCALED_IMU_DATA::ID,
32753 Self::SCALED_IMU2(..) => SCALED_IMU2_DATA::ID,
32754 Self::SCALED_IMU3(..) => SCALED_IMU3_DATA::ID,
32755 Self::SCALED_PRESSURE(..) => SCALED_PRESSURE_DATA::ID,
32756 Self::SCALED_PRESSURE2(..) => SCALED_PRESSURE2_DATA::ID,
32757 Self::SCALED_PRESSURE3(..) => SCALED_PRESSURE3_DATA::ID,
32758 Self::SCRIPT_COUNT(..) => SCRIPT_COUNT_DATA::ID,
32759 Self::SCRIPT_CURRENT(..) => SCRIPT_CURRENT_DATA::ID,
32760 Self::SCRIPT_ITEM(..) => SCRIPT_ITEM_DATA::ID,
32761 Self::SCRIPT_REQUEST(..) => SCRIPT_REQUEST_DATA::ID,
32762 Self::SCRIPT_REQUEST_LIST(..) => SCRIPT_REQUEST_LIST_DATA::ID,
32763 Self::SERIAL_CONTROL(..) => SERIAL_CONTROL_DATA::ID,
32764 Self::SERVO_OUTPUT_RAW(..) => SERVO_OUTPUT_RAW_DATA::ID,
32765 Self::SETUP_SIGNING(..) => SETUP_SIGNING_DATA::ID,
32766 Self::SET_ACTUATOR_CONTROL_TARGET(..) => SET_ACTUATOR_CONTROL_TARGET_DATA::ID,
32767 Self::SET_ATTITUDE_TARGET(..) => SET_ATTITUDE_TARGET_DATA::ID,
32768 Self::SET_GPS_GLOBAL_ORIGIN(..) => SET_GPS_GLOBAL_ORIGIN_DATA::ID,
32769 Self::SET_HOME_POSITION(..) => SET_HOME_POSITION_DATA::ID,
32770 Self::SET_MODE(..) => SET_MODE_DATA::ID,
32771 Self::SET_POSITION_TARGET_GLOBAL_INT(..) => SET_POSITION_TARGET_GLOBAL_INT_DATA::ID,
32772 Self::SET_POSITION_TARGET_LOCAL_NED(..) => SET_POSITION_TARGET_LOCAL_NED_DATA::ID,
32773 Self::SIM_STATE(..) => SIM_STATE_DATA::ID,
32774 Self::SMART_BATTERY_INFO(..) => SMART_BATTERY_INFO_DATA::ID,
32775 Self::STATUSTEXT(..) => STATUSTEXT_DATA::ID,
32776 Self::STORAGE_INFORMATION(..) => STORAGE_INFORMATION_DATA::ID,
32777 Self::SUPPORTED_TUNES(..) => SUPPORTED_TUNES_DATA::ID,
32778 Self::SYSTEM_TIME(..) => SYSTEM_TIME_DATA::ID,
32779 Self::SYS_STATUS(..) => SYS_STATUS_DATA::ID,
32780 Self::TERRAIN_CHECK(..) => TERRAIN_CHECK_DATA::ID,
32781 Self::TERRAIN_DATA(..) => TERRAIN_DATA_DATA::ID,
32782 Self::TERRAIN_REPORT(..) => TERRAIN_REPORT_DATA::ID,
32783 Self::TERRAIN_REQUEST(..) => TERRAIN_REQUEST_DATA::ID,
32784 Self::TIMESYNC(..) => TIMESYNC_DATA::ID,
32785 Self::TIME_ESTIMATE_TO_TARGET(..) => TIME_ESTIMATE_TO_TARGET_DATA::ID,
32786 Self::TRAJECTORY_REPRESENTATION_BEZIER(..) => TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID,
32787 Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(..) => {
32788 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID
32789 }
32790 Self::TUNNEL(..) => TUNNEL_DATA::ID,
32791 Self::UAVCAN_NODE_INFO(..) => UAVCAN_NODE_INFO_DATA::ID,
32792 Self::UAVCAN_NODE_STATUS(..) => UAVCAN_NODE_STATUS_DATA::ID,
32793 Self::UTM_GLOBAL_POSITION(..) => UTM_GLOBAL_POSITION_DATA::ID,
32794 Self::V2_EXTENSION(..) => V2_EXTENSION_DATA::ID,
32795 Self::VFR_HUD(..) => VFR_HUD_DATA::ID,
32796 Self::VIBRATION(..) => VIBRATION_DATA::ID,
32797 Self::VICON_POSITION_ESTIMATE(..) => VICON_POSITION_ESTIMATE_DATA::ID,
32798 Self::VIDEO_STREAM_INFORMATION(..) => VIDEO_STREAM_INFORMATION_DATA::ID,
32799 Self::VIDEO_STREAM_STATUS(..) => VIDEO_STREAM_STATUS_DATA::ID,
32800 Self::VISION_POSITION_ESTIMATE(..) => VISION_POSITION_ESTIMATE_DATA::ID,
32801 Self::VISION_SPEED_ESTIMATE(..) => VISION_SPEED_ESTIMATE_DATA::ID,
32802 Self::WHEEL_DISTANCE(..) => WHEEL_DISTANCE_DATA::ID,
32803 Self::WIFI_CONFIG_AP(..) => WIFI_CONFIG_AP_DATA::ID,
32804 Self::WINCH_STATUS(..) => WINCH_STATUS_DATA::ID,
32805 Self::WIND_COV(..) => WIND_COV_DATA::ID,
32806 }
32807 }
32808 fn message_id_from_name(name: &str) -> Option<u32> {
32809 match name {
32810 ACTUATOR_CONTROL_TARGET_DATA::NAME => Some(ACTUATOR_CONTROL_TARGET_DATA::ID),
32811 ACTUATOR_OUTPUT_STATUS_DATA::NAME => Some(ACTUATOR_OUTPUT_STATUS_DATA::ID),
32812 ADSB_VEHICLE_DATA::NAME => Some(ADSB_VEHICLE_DATA::ID),
32813 AIS_VESSEL_DATA::NAME => Some(AIS_VESSEL_DATA::ID),
32814 ALTITUDE_DATA::NAME => Some(ALTITUDE_DATA::ID),
32815 ATTITUDE_DATA::NAME => Some(ATTITUDE_DATA::ID),
32816 ATTITUDE_QUATERNION_DATA::NAME => Some(ATTITUDE_QUATERNION_DATA::ID),
32817 ATTITUDE_QUATERNION_COV_DATA::NAME => Some(ATTITUDE_QUATERNION_COV_DATA::ID),
32818 ATTITUDE_TARGET_DATA::NAME => Some(ATTITUDE_TARGET_DATA::ID),
32819 ATT_POS_MOCAP_DATA::NAME => Some(ATT_POS_MOCAP_DATA::ID),
32820 AUTH_KEY_DATA::NAME => Some(AUTH_KEY_DATA::ID),
32821 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::NAME => {
32822 Some(AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID)
32823 }
32824 AUTOPILOT_VERSION_DATA::NAME => Some(AUTOPILOT_VERSION_DATA::ID),
32825 AVAILABLE_MODES_DATA::NAME => Some(AVAILABLE_MODES_DATA::ID),
32826 AVAILABLE_MODES_MONITOR_DATA::NAME => Some(AVAILABLE_MODES_MONITOR_DATA::ID),
32827 BATTERY_INFO_DATA::NAME => Some(BATTERY_INFO_DATA::ID),
32828 BATTERY_STATUS_DATA::NAME => Some(BATTERY_STATUS_DATA::ID),
32829 BUTTON_CHANGE_DATA::NAME => Some(BUTTON_CHANGE_DATA::ID),
32830 CAMERA_CAPTURE_STATUS_DATA::NAME => Some(CAMERA_CAPTURE_STATUS_DATA::ID),
32831 CAMERA_FOV_STATUS_DATA::NAME => Some(CAMERA_FOV_STATUS_DATA::ID),
32832 CAMERA_IMAGE_CAPTURED_DATA::NAME => Some(CAMERA_IMAGE_CAPTURED_DATA::ID),
32833 CAMERA_INFORMATION_DATA::NAME => Some(CAMERA_INFORMATION_DATA::ID),
32834 CAMERA_SETTINGS_DATA::NAME => Some(CAMERA_SETTINGS_DATA::ID),
32835 CAMERA_THERMAL_RANGE_DATA::NAME => Some(CAMERA_THERMAL_RANGE_DATA::ID),
32836 CAMERA_TRACKING_GEO_STATUS_DATA::NAME => Some(CAMERA_TRACKING_GEO_STATUS_DATA::ID),
32837 CAMERA_TRACKING_IMAGE_STATUS_DATA::NAME => Some(CAMERA_TRACKING_IMAGE_STATUS_DATA::ID),
32838 CAMERA_TRIGGER_DATA::NAME => Some(CAMERA_TRIGGER_DATA::ID),
32839 CANFD_FRAME_DATA::NAME => Some(CANFD_FRAME_DATA::ID),
32840 CAN_FILTER_MODIFY_DATA::NAME => Some(CAN_FILTER_MODIFY_DATA::ID),
32841 CAN_FRAME_DATA::NAME => Some(CAN_FRAME_DATA::ID),
32842 CELLULAR_CONFIG_DATA::NAME => Some(CELLULAR_CONFIG_DATA::ID),
32843 CELLULAR_STATUS_DATA::NAME => Some(CELLULAR_STATUS_DATA::ID),
32844 CHANGE_OPERATOR_CONTROL_DATA::NAME => Some(CHANGE_OPERATOR_CONTROL_DATA::ID),
32845 CHANGE_OPERATOR_CONTROL_ACK_DATA::NAME => Some(CHANGE_OPERATOR_CONTROL_ACK_DATA::ID),
32846 COLLISION_DATA::NAME => Some(COLLISION_DATA::ID),
32847 COMMAND_ACK_DATA::NAME => Some(COMMAND_ACK_DATA::ID),
32848 COMMAND_CANCEL_DATA::NAME => Some(COMMAND_CANCEL_DATA::ID),
32849 COMMAND_INT_DATA::NAME => Some(COMMAND_INT_DATA::ID),
32850 COMMAND_LONG_DATA::NAME => Some(COMMAND_LONG_DATA::ID),
32851 COMPONENT_INFORMATION_DATA::NAME => Some(COMPONENT_INFORMATION_DATA::ID),
32852 COMPONENT_INFORMATION_BASIC_DATA::NAME => Some(COMPONENT_INFORMATION_BASIC_DATA::ID),
32853 COMPONENT_METADATA_DATA::NAME => Some(COMPONENT_METADATA_DATA::ID),
32854 CONTROL_SYSTEM_STATE_DATA::NAME => Some(CONTROL_SYSTEM_STATE_DATA::ID),
32855 CURRENT_EVENT_SEQUENCE_DATA::NAME => Some(CURRENT_EVENT_SEQUENCE_DATA::ID),
32856 CURRENT_MODE_DATA::NAME => Some(CURRENT_MODE_DATA::ID),
32857 DATA_STREAM_DATA::NAME => Some(DATA_STREAM_DATA::ID),
32858 DATA_TRANSMISSION_HANDSHAKE_DATA::NAME => Some(DATA_TRANSMISSION_HANDSHAKE_DATA::ID),
32859 DEBUG_DATA::NAME => Some(DEBUG_DATA::ID),
32860 DEBUG_FLOAT_ARRAY_DATA::NAME => Some(DEBUG_FLOAT_ARRAY_DATA::ID),
32861 DEBUG_VECT_DATA::NAME => Some(DEBUG_VECT_DATA::ID),
32862 DISTANCE_SENSOR_DATA::NAME => Some(DISTANCE_SENSOR_DATA::ID),
32863 EFI_STATUS_DATA::NAME => Some(EFI_STATUS_DATA::ID),
32864 ENCAPSULATED_DATA_DATA::NAME => Some(ENCAPSULATED_DATA_DATA::ID),
32865 ESC_INFO_DATA::NAME => Some(ESC_INFO_DATA::ID),
32866 ESC_STATUS_DATA::NAME => Some(ESC_STATUS_DATA::ID),
32867 ESTIMATOR_STATUS_DATA::NAME => Some(ESTIMATOR_STATUS_DATA::ID),
32868 EVENT_DATA::NAME => Some(EVENT_DATA::ID),
32869 EXTENDED_SYS_STATE_DATA::NAME => Some(EXTENDED_SYS_STATE_DATA::ID),
32870 FENCE_STATUS_DATA::NAME => Some(FENCE_STATUS_DATA::ID),
32871 FILE_TRANSFER_PROTOCOL_DATA::NAME => Some(FILE_TRANSFER_PROTOCOL_DATA::ID),
32872 FLIGHT_INFORMATION_DATA::NAME => Some(FLIGHT_INFORMATION_DATA::ID),
32873 FOLLOW_TARGET_DATA::NAME => Some(FOLLOW_TARGET_DATA::ID),
32874 FUEL_STATUS_DATA::NAME => Some(FUEL_STATUS_DATA::ID),
32875 GENERATOR_STATUS_DATA::NAME => Some(GENERATOR_STATUS_DATA::ID),
32876 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::NAME => {
32877 Some(GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID)
32878 }
32879 GIMBAL_DEVICE_INFORMATION_DATA::NAME => Some(GIMBAL_DEVICE_INFORMATION_DATA::ID),
32880 GIMBAL_DEVICE_SET_ATTITUDE_DATA::NAME => Some(GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID),
32881 GIMBAL_MANAGER_INFORMATION_DATA::NAME => Some(GIMBAL_MANAGER_INFORMATION_DATA::ID),
32882 GIMBAL_MANAGER_SET_ATTITUDE_DATA::NAME => Some(GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID),
32883 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::NAME => {
32884 Some(GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID)
32885 }
32886 GIMBAL_MANAGER_SET_PITCHYAW_DATA::NAME => Some(GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID),
32887 GIMBAL_MANAGER_STATUS_DATA::NAME => Some(GIMBAL_MANAGER_STATUS_DATA::ID),
32888 GLOBAL_POSITION_INT_DATA::NAME => Some(GLOBAL_POSITION_INT_DATA::ID),
32889 GLOBAL_POSITION_INT_COV_DATA::NAME => Some(GLOBAL_POSITION_INT_COV_DATA::ID),
32890 GLOBAL_VISION_POSITION_ESTIMATE_DATA::NAME => {
32891 Some(GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID)
32892 }
32893 GPS2_RAW_DATA::NAME => Some(GPS2_RAW_DATA::ID),
32894 GPS2_RTK_DATA::NAME => Some(GPS2_RTK_DATA::ID),
32895 GPS_GLOBAL_ORIGIN_DATA::NAME => Some(GPS_GLOBAL_ORIGIN_DATA::ID),
32896 GPS_INJECT_DATA_DATA::NAME => Some(GPS_INJECT_DATA_DATA::ID),
32897 GPS_INPUT_DATA::NAME => Some(GPS_INPUT_DATA::ID),
32898 GPS_RAW_INT_DATA::NAME => Some(GPS_RAW_INT_DATA::ID),
32899 GPS_RTCM_DATA_DATA::NAME => Some(GPS_RTCM_DATA_DATA::ID),
32900 GPS_RTK_DATA::NAME => Some(GPS_RTK_DATA::ID),
32901 GPS_STATUS_DATA::NAME => Some(GPS_STATUS_DATA::ID),
32902 HEARTBEAT_DATA::NAME => Some(HEARTBEAT_DATA::ID),
32903 HIGHRES_IMU_DATA::NAME => Some(HIGHRES_IMU_DATA::ID),
32904 HIGH_LATENCY_DATA::NAME => Some(HIGH_LATENCY_DATA::ID),
32905 HIGH_LATENCY2_DATA::NAME => Some(HIGH_LATENCY2_DATA::ID),
32906 HIL_ACTUATOR_CONTROLS_DATA::NAME => Some(HIL_ACTUATOR_CONTROLS_DATA::ID),
32907 HIL_CONTROLS_DATA::NAME => Some(HIL_CONTROLS_DATA::ID),
32908 HIL_GPS_DATA::NAME => Some(HIL_GPS_DATA::ID),
32909 HIL_OPTICAL_FLOW_DATA::NAME => Some(HIL_OPTICAL_FLOW_DATA::ID),
32910 HIL_RC_INPUTS_RAW_DATA::NAME => Some(HIL_RC_INPUTS_RAW_DATA::ID),
32911 HIL_SENSOR_DATA::NAME => Some(HIL_SENSOR_DATA::ID),
32912 HIL_STATE_DATA::NAME => Some(HIL_STATE_DATA::ID),
32913 HIL_STATE_QUATERNION_DATA::NAME => Some(HIL_STATE_QUATERNION_DATA::ID),
32914 HOME_POSITION_DATA::NAME => Some(HOME_POSITION_DATA::ID),
32915 HYGROMETER_SENSOR_DATA::NAME => Some(HYGROMETER_SENSOR_DATA::ID),
32916 ILLUMINATOR_STATUS_DATA::NAME => Some(ILLUMINATOR_STATUS_DATA::ID),
32917 ISBD_LINK_STATUS_DATA::NAME => Some(ISBD_LINK_STATUS_DATA::ID),
32918 LANDING_TARGET_DATA::NAME => Some(LANDING_TARGET_DATA::ID),
32919 LINK_NODE_STATUS_DATA::NAME => Some(LINK_NODE_STATUS_DATA::ID),
32920 LOCAL_POSITION_NED_DATA::NAME => Some(LOCAL_POSITION_NED_DATA::ID),
32921 LOCAL_POSITION_NED_COV_DATA::NAME => Some(LOCAL_POSITION_NED_COV_DATA::ID),
32922 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::NAME => {
32923 Some(LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID)
32924 }
32925 LOGGING_ACK_DATA::NAME => Some(LOGGING_ACK_DATA::ID),
32926 LOGGING_DATA_DATA::NAME => Some(LOGGING_DATA_DATA::ID),
32927 LOGGING_DATA_ACKED_DATA::NAME => Some(LOGGING_DATA_ACKED_DATA::ID),
32928 LOG_DATA_DATA::NAME => Some(LOG_DATA_DATA::ID),
32929 LOG_ENTRY_DATA::NAME => Some(LOG_ENTRY_DATA::ID),
32930 LOG_ERASE_DATA::NAME => Some(LOG_ERASE_DATA::ID),
32931 LOG_REQUEST_DATA_DATA::NAME => Some(LOG_REQUEST_DATA_DATA::ID),
32932 LOG_REQUEST_END_DATA::NAME => Some(LOG_REQUEST_END_DATA::ID),
32933 LOG_REQUEST_LIST_DATA::NAME => Some(LOG_REQUEST_LIST_DATA::ID),
32934 MAG_CAL_REPORT_DATA::NAME => Some(MAG_CAL_REPORT_DATA::ID),
32935 MANUAL_CONTROL_DATA::NAME => Some(MANUAL_CONTROL_DATA::ID),
32936 MANUAL_SETPOINT_DATA::NAME => Some(MANUAL_SETPOINT_DATA::ID),
32937 MEMORY_VECT_DATA::NAME => Some(MEMORY_VECT_DATA::ID),
32938 MESSAGE_INTERVAL_DATA::NAME => Some(MESSAGE_INTERVAL_DATA::ID),
32939 MISSION_ACK_DATA::NAME => Some(MISSION_ACK_DATA::ID),
32940 MISSION_CLEAR_ALL_DATA::NAME => Some(MISSION_CLEAR_ALL_DATA::ID),
32941 MISSION_COUNT_DATA::NAME => Some(MISSION_COUNT_DATA::ID),
32942 MISSION_CURRENT_DATA::NAME => Some(MISSION_CURRENT_DATA::ID),
32943 MISSION_ITEM_DATA::NAME => Some(MISSION_ITEM_DATA::ID),
32944 MISSION_ITEM_INT_DATA::NAME => Some(MISSION_ITEM_INT_DATA::ID),
32945 MISSION_ITEM_REACHED_DATA::NAME => Some(MISSION_ITEM_REACHED_DATA::ID),
32946 MISSION_REQUEST_DATA::NAME => Some(MISSION_REQUEST_DATA::ID),
32947 MISSION_REQUEST_INT_DATA::NAME => Some(MISSION_REQUEST_INT_DATA::ID),
32948 MISSION_REQUEST_LIST_DATA::NAME => Some(MISSION_REQUEST_LIST_DATA::ID),
32949 MISSION_REQUEST_PARTIAL_LIST_DATA::NAME => Some(MISSION_REQUEST_PARTIAL_LIST_DATA::ID),
32950 MISSION_SET_CURRENT_DATA::NAME => Some(MISSION_SET_CURRENT_DATA::ID),
32951 MISSION_WRITE_PARTIAL_LIST_DATA::NAME => Some(MISSION_WRITE_PARTIAL_LIST_DATA::ID),
32952 MOUNT_ORIENTATION_DATA::NAME => Some(MOUNT_ORIENTATION_DATA::ID),
32953 NAMED_VALUE_FLOAT_DATA::NAME => Some(NAMED_VALUE_FLOAT_DATA::ID),
32954 NAMED_VALUE_INT_DATA::NAME => Some(NAMED_VALUE_INT_DATA::ID),
32955 NAV_CONTROLLER_OUTPUT_DATA::NAME => Some(NAV_CONTROLLER_OUTPUT_DATA::ID),
32956 OBSTACLE_DISTANCE_DATA::NAME => Some(OBSTACLE_DISTANCE_DATA::ID),
32957 ODOMETRY_DATA::NAME => Some(ODOMETRY_DATA::ID),
32958 ONBOARD_COMPUTER_STATUS_DATA::NAME => Some(ONBOARD_COMPUTER_STATUS_DATA::ID),
32959 OPEN_DRONE_ID_ARM_STATUS_DATA::NAME => Some(OPEN_DRONE_ID_ARM_STATUS_DATA::ID),
32960 OPEN_DRONE_ID_AUTHENTICATION_DATA::NAME => Some(OPEN_DRONE_ID_AUTHENTICATION_DATA::ID),
32961 OPEN_DRONE_ID_BASIC_ID_DATA::NAME => Some(OPEN_DRONE_ID_BASIC_ID_DATA::ID),
32962 OPEN_DRONE_ID_LOCATION_DATA::NAME => Some(OPEN_DRONE_ID_LOCATION_DATA::ID),
32963 OPEN_DRONE_ID_MESSAGE_PACK_DATA::NAME => Some(OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID),
32964 OPEN_DRONE_ID_OPERATOR_ID_DATA::NAME => Some(OPEN_DRONE_ID_OPERATOR_ID_DATA::ID),
32965 OPEN_DRONE_ID_SELF_ID_DATA::NAME => Some(OPEN_DRONE_ID_SELF_ID_DATA::ID),
32966 OPEN_DRONE_ID_SYSTEM_DATA::NAME => Some(OPEN_DRONE_ID_SYSTEM_DATA::ID),
32967 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::NAME => Some(OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID),
32968 OPTICAL_FLOW_DATA::NAME => Some(OPTICAL_FLOW_DATA::ID),
32969 OPTICAL_FLOW_RAD_DATA::NAME => Some(OPTICAL_FLOW_RAD_DATA::ID),
32970 ORBIT_EXECUTION_STATUS_DATA::NAME => Some(ORBIT_EXECUTION_STATUS_DATA::ID),
32971 PARAM_EXT_ACK_DATA::NAME => Some(PARAM_EXT_ACK_DATA::ID),
32972 PARAM_EXT_REQUEST_LIST_DATA::NAME => Some(PARAM_EXT_REQUEST_LIST_DATA::ID),
32973 PARAM_EXT_REQUEST_READ_DATA::NAME => Some(PARAM_EXT_REQUEST_READ_DATA::ID),
32974 PARAM_EXT_SET_DATA::NAME => Some(PARAM_EXT_SET_DATA::ID),
32975 PARAM_EXT_VALUE_DATA::NAME => Some(PARAM_EXT_VALUE_DATA::ID),
32976 PARAM_MAP_RC_DATA::NAME => Some(PARAM_MAP_RC_DATA::ID),
32977 PARAM_REQUEST_LIST_DATA::NAME => Some(PARAM_REQUEST_LIST_DATA::ID),
32978 PARAM_REQUEST_READ_DATA::NAME => Some(PARAM_REQUEST_READ_DATA::ID),
32979 PARAM_SET_DATA::NAME => Some(PARAM_SET_DATA::ID),
32980 PARAM_VALUE_DATA::NAME => Some(PARAM_VALUE_DATA::ID),
32981 PING_DATA::NAME => Some(PING_DATA::ID),
32982 PLAY_TUNE_DATA::NAME => Some(PLAY_TUNE_DATA::ID),
32983 PLAY_TUNE_V2_DATA::NAME => Some(PLAY_TUNE_V2_DATA::ID),
32984 POSITION_TARGET_GLOBAL_INT_DATA::NAME => Some(POSITION_TARGET_GLOBAL_INT_DATA::ID),
32985 POSITION_TARGET_LOCAL_NED_DATA::NAME => Some(POSITION_TARGET_LOCAL_NED_DATA::ID),
32986 POWER_STATUS_DATA::NAME => Some(POWER_STATUS_DATA::ID),
32987 PROTOCOL_VERSION_DATA::NAME => Some(PROTOCOL_VERSION_DATA::ID),
32988 RADIO_STATUS_DATA::NAME => Some(RADIO_STATUS_DATA::ID),
32989 RAW_IMU_DATA::NAME => Some(RAW_IMU_DATA::ID),
32990 RAW_PRESSURE_DATA::NAME => Some(RAW_PRESSURE_DATA::ID),
32991 RAW_RPM_DATA::NAME => Some(RAW_RPM_DATA::ID),
32992 RC_CHANNELS_DATA::NAME => Some(RC_CHANNELS_DATA::ID),
32993 RC_CHANNELS_OVERRIDE_DATA::NAME => Some(RC_CHANNELS_OVERRIDE_DATA::ID),
32994 RC_CHANNELS_RAW_DATA::NAME => Some(RC_CHANNELS_RAW_DATA::ID),
32995 RC_CHANNELS_SCALED_DATA::NAME => Some(RC_CHANNELS_SCALED_DATA::ID),
32996 REQUEST_DATA_STREAM_DATA::NAME => Some(REQUEST_DATA_STREAM_DATA::ID),
32997 REQUEST_EVENT_DATA::NAME => Some(REQUEST_EVENT_DATA::ID),
32998 RESOURCE_REQUEST_DATA::NAME => Some(RESOURCE_REQUEST_DATA::ID),
32999 RESPONSE_EVENT_ERROR_DATA::NAME => Some(RESPONSE_EVENT_ERROR_DATA::ID),
33000 SAFETY_ALLOWED_AREA_DATA::NAME => Some(SAFETY_ALLOWED_AREA_DATA::ID),
33001 SAFETY_SET_ALLOWED_AREA_DATA::NAME => Some(SAFETY_SET_ALLOWED_AREA_DATA::ID),
33002 SCALED_IMU_DATA::NAME => Some(SCALED_IMU_DATA::ID),
33003 SCALED_IMU2_DATA::NAME => Some(SCALED_IMU2_DATA::ID),
33004 SCALED_IMU3_DATA::NAME => Some(SCALED_IMU3_DATA::ID),
33005 SCALED_PRESSURE_DATA::NAME => Some(SCALED_PRESSURE_DATA::ID),
33006 SCALED_PRESSURE2_DATA::NAME => Some(SCALED_PRESSURE2_DATA::ID),
33007 SCALED_PRESSURE3_DATA::NAME => Some(SCALED_PRESSURE3_DATA::ID),
33008 SCRIPT_COUNT_DATA::NAME => Some(SCRIPT_COUNT_DATA::ID),
33009 SCRIPT_CURRENT_DATA::NAME => Some(SCRIPT_CURRENT_DATA::ID),
33010 SCRIPT_ITEM_DATA::NAME => Some(SCRIPT_ITEM_DATA::ID),
33011 SCRIPT_REQUEST_DATA::NAME => Some(SCRIPT_REQUEST_DATA::ID),
33012 SCRIPT_REQUEST_LIST_DATA::NAME => Some(SCRIPT_REQUEST_LIST_DATA::ID),
33013 SERIAL_CONTROL_DATA::NAME => Some(SERIAL_CONTROL_DATA::ID),
33014 SERVO_OUTPUT_RAW_DATA::NAME => Some(SERVO_OUTPUT_RAW_DATA::ID),
33015 SETUP_SIGNING_DATA::NAME => Some(SETUP_SIGNING_DATA::ID),
33016 SET_ACTUATOR_CONTROL_TARGET_DATA::NAME => Some(SET_ACTUATOR_CONTROL_TARGET_DATA::ID),
33017 SET_ATTITUDE_TARGET_DATA::NAME => Some(SET_ATTITUDE_TARGET_DATA::ID),
33018 SET_GPS_GLOBAL_ORIGIN_DATA::NAME => Some(SET_GPS_GLOBAL_ORIGIN_DATA::ID),
33019 SET_HOME_POSITION_DATA::NAME => Some(SET_HOME_POSITION_DATA::ID),
33020 SET_MODE_DATA::NAME => Some(SET_MODE_DATA::ID),
33021 SET_POSITION_TARGET_GLOBAL_INT_DATA::NAME => {
33022 Some(SET_POSITION_TARGET_GLOBAL_INT_DATA::ID)
33023 }
33024 SET_POSITION_TARGET_LOCAL_NED_DATA::NAME => {
33025 Some(SET_POSITION_TARGET_LOCAL_NED_DATA::ID)
33026 }
33027 SIM_STATE_DATA::NAME => Some(SIM_STATE_DATA::ID),
33028 SMART_BATTERY_INFO_DATA::NAME => Some(SMART_BATTERY_INFO_DATA::ID),
33029 STATUSTEXT_DATA::NAME => Some(STATUSTEXT_DATA::ID),
33030 STORAGE_INFORMATION_DATA::NAME => Some(STORAGE_INFORMATION_DATA::ID),
33031 SUPPORTED_TUNES_DATA::NAME => Some(SUPPORTED_TUNES_DATA::ID),
33032 SYSTEM_TIME_DATA::NAME => Some(SYSTEM_TIME_DATA::ID),
33033 SYS_STATUS_DATA::NAME => Some(SYS_STATUS_DATA::ID),
33034 TERRAIN_CHECK_DATA::NAME => Some(TERRAIN_CHECK_DATA::ID),
33035 TERRAIN_DATA_DATA::NAME => Some(TERRAIN_DATA_DATA::ID),
33036 TERRAIN_REPORT_DATA::NAME => Some(TERRAIN_REPORT_DATA::ID),
33037 TERRAIN_REQUEST_DATA::NAME => Some(TERRAIN_REQUEST_DATA::ID),
33038 TIMESYNC_DATA::NAME => Some(TIMESYNC_DATA::ID),
33039 TIME_ESTIMATE_TO_TARGET_DATA::NAME => Some(TIME_ESTIMATE_TO_TARGET_DATA::ID),
33040 TRAJECTORY_REPRESENTATION_BEZIER_DATA::NAME => {
33041 Some(TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID)
33042 }
33043 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::NAME => {
33044 Some(TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID)
33045 }
33046 TUNNEL_DATA::NAME => Some(TUNNEL_DATA::ID),
33047 UAVCAN_NODE_INFO_DATA::NAME => Some(UAVCAN_NODE_INFO_DATA::ID),
33048 UAVCAN_NODE_STATUS_DATA::NAME => Some(UAVCAN_NODE_STATUS_DATA::ID),
33049 UTM_GLOBAL_POSITION_DATA::NAME => Some(UTM_GLOBAL_POSITION_DATA::ID),
33050 V2_EXTENSION_DATA::NAME => Some(V2_EXTENSION_DATA::ID),
33051 VFR_HUD_DATA::NAME => Some(VFR_HUD_DATA::ID),
33052 VIBRATION_DATA::NAME => Some(VIBRATION_DATA::ID),
33053 VICON_POSITION_ESTIMATE_DATA::NAME => Some(VICON_POSITION_ESTIMATE_DATA::ID),
33054 VIDEO_STREAM_INFORMATION_DATA::NAME => Some(VIDEO_STREAM_INFORMATION_DATA::ID),
33055 VIDEO_STREAM_STATUS_DATA::NAME => Some(VIDEO_STREAM_STATUS_DATA::ID),
33056 VISION_POSITION_ESTIMATE_DATA::NAME => Some(VISION_POSITION_ESTIMATE_DATA::ID),
33057 VISION_SPEED_ESTIMATE_DATA::NAME => Some(VISION_SPEED_ESTIMATE_DATA::ID),
33058 WHEEL_DISTANCE_DATA::NAME => Some(WHEEL_DISTANCE_DATA::ID),
33059 WIFI_CONFIG_AP_DATA::NAME => Some(WIFI_CONFIG_AP_DATA::ID),
33060 WINCH_STATUS_DATA::NAME => Some(WINCH_STATUS_DATA::ID),
33061 WIND_COV_DATA::NAME => Some(WIND_COV_DATA::ID),
33062 _ => None,
33063 }
33064 }
33065 fn default_message_from_id(id: u32) -> Option<Self> {
33066 match id {
33067 ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::ACTUATOR_CONTROL_TARGET(
33068 ACTUATOR_CONTROL_TARGET_DATA::default(),
33069 )),
33070 ACTUATOR_OUTPUT_STATUS_DATA::ID => Some(Self::ACTUATOR_OUTPUT_STATUS(
33071 ACTUATOR_OUTPUT_STATUS_DATA::default(),
33072 )),
33073 ADSB_VEHICLE_DATA::ID => Some(Self::ADSB_VEHICLE(ADSB_VEHICLE_DATA::default())),
33074 AIS_VESSEL_DATA::ID => Some(Self::AIS_VESSEL(AIS_VESSEL_DATA::default())),
33075 ALTITUDE_DATA::ID => Some(Self::ALTITUDE(ALTITUDE_DATA::default())),
33076 ATTITUDE_DATA::ID => Some(Self::ATTITUDE(ATTITUDE_DATA::default())),
33077 ATTITUDE_QUATERNION_DATA::ID => Some(Self::ATTITUDE_QUATERNION(
33078 ATTITUDE_QUATERNION_DATA::default(),
33079 )),
33080 ATTITUDE_QUATERNION_COV_DATA::ID => Some(Self::ATTITUDE_QUATERNION_COV(
33081 ATTITUDE_QUATERNION_COV_DATA::default(),
33082 )),
33083 ATTITUDE_TARGET_DATA::ID => {
33084 Some(Self::ATTITUDE_TARGET(ATTITUDE_TARGET_DATA::default()))
33085 }
33086 ATT_POS_MOCAP_DATA::ID => Some(Self::ATT_POS_MOCAP(ATT_POS_MOCAP_DATA::default())),
33087 AUTH_KEY_DATA::ID => Some(Self::AUTH_KEY(AUTH_KEY_DATA::default())),
33088 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
33089 Some(Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(
33090 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::default(),
33091 ))
33092 }
33093 AUTOPILOT_VERSION_DATA::ID => {
33094 Some(Self::AUTOPILOT_VERSION(AUTOPILOT_VERSION_DATA::default()))
33095 }
33096 AVAILABLE_MODES_DATA::ID => {
33097 Some(Self::AVAILABLE_MODES(AVAILABLE_MODES_DATA::default()))
33098 }
33099 AVAILABLE_MODES_MONITOR_DATA::ID => Some(Self::AVAILABLE_MODES_MONITOR(
33100 AVAILABLE_MODES_MONITOR_DATA::default(),
33101 )),
33102 BATTERY_INFO_DATA::ID => Some(Self::BATTERY_INFO(BATTERY_INFO_DATA::default())),
33103 BATTERY_STATUS_DATA::ID => Some(Self::BATTERY_STATUS(BATTERY_STATUS_DATA::default())),
33104 BUTTON_CHANGE_DATA::ID => Some(Self::BUTTON_CHANGE(BUTTON_CHANGE_DATA::default())),
33105 CAMERA_CAPTURE_STATUS_DATA::ID => Some(Self::CAMERA_CAPTURE_STATUS(
33106 CAMERA_CAPTURE_STATUS_DATA::default(),
33107 )),
33108 CAMERA_FOV_STATUS_DATA::ID => {
33109 Some(Self::CAMERA_FOV_STATUS(CAMERA_FOV_STATUS_DATA::default()))
33110 }
33111 CAMERA_IMAGE_CAPTURED_DATA::ID => Some(Self::CAMERA_IMAGE_CAPTURED(
33112 CAMERA_IMAGE_CAPTURED_DATA::default(),
33113 )),
33114 CAMERA_INFORMATION_DATA::ID => {
33115 Some(Self::CAMERA_INFORMATION(CAMERA_INFORMATION_DATA::default()))
33116 }
33117 CAMERA_SETTINGS_DATA::ID => {
33118 Some(Self::CAMERA_SETTINGS(CAMERA_SETTINGS_DATA::default()))
33119 }
33120 CAMERA_THERMAL_RANGE_DATA::ID => Some(Self::CAMERA_THERMAL_RANGE(
33121 CAMERA_THERMAL_RANGE_DATA::default(),
33122 )),
33123 CAMERA_TRACKING_GEO_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_GEO_STATUS(
33124 CAMERA_TRACKING_GEO_STATUS_DATA::default(),
33125 )),
33126 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_IMAGE_STATUS(
33127 CAMERA_TRACKING_IMAGE_STATUS_DATA::default(),
33128 )),
33129 CAMERA_TRIGGER_DATA::ID => Some(Self::CAMERA_TRIGGER(CAMERA_TRIGGER_DATA::default())),
33130 CANFD_FRAME_DATA::ID => Some(Self::CANFD_FRAME(CANFD_FRAME_DATA::default())),
33131 CAN_FILTER_MODIFY_DATA::ID => {
33132 Some(Self::CAN_FILTER_MODIFY(CAN_FILTER_MODIFY_DATA::default()))
33133 }
33134 CAN_FRAME_DATA::ID => Some(Self::CAN_FRAME(CAN_FRAME_DATA::default())),
33135 CELLULAR_CONFIG_DATA::ID => {
33136 Some(Self::CELLULAR_CONFIG(CELLULAR_CONFIG_DATA::default()))
33137 }
33138 CELLULAR_STATUS_DATA::ID => {
33139 Some(Self::CELLULAR_STATUS(CELLULAR_STATUS_DATA::default()))
33140 }
33141 CHANGE_OPERATOR_CONTROL_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL(
33142 CHANGE_OPERATOR_CONTROL_DATA::default(),
33143 )),
33144 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL_ACK(
33145 CHANGE_OPERATOR_CONTROL_ACK_DATA::default(),
33146 )),
33147 COLLISION_DATA::ID => Some(Self::COLLISION(COLLISION_DATA::default())),
33148 COMMAND_ACK_DATA::ID => Some(Self::COMMAND_ACK(COMMAND_ACK_DATA::default())),
33149 COMMAND_CANCEL_DATA::ID => Some(Self::COMMAND_CANCEL(COMMAND_CANCEL_DATA::default())),
33150 COMMAND_INT_DATA::ID => Some(Self::COMMAND_INT(COMMAND_INT_DATA::default())),
33151 COMMAND_LONG_DATA::ID => Some(Self::COMMAND_LONG(COMMAND_LONG_DATA::default())),
33152 COMPONENT_INFORMATION_DATA::ID => Some(Self::COMPONENT_INFORMATION(
33153 COMPONENT_INFORMATION_DATA::default(),
33154 )),
33155 COMPONENT_INFORMATION_BASIC_DATA::ID => Some(Self::COMPONENT_INFORMATION_BASIC(
33156 COMPONENT_INFORMATION_BASIC_DATA::default(),
33157 )),
33158 COMPONENT_METADATA_DATA::ID => {
33159 Some(Self::COMPONENT_METADATA(COMPONENT_METADATA_DATA::default()))
33160 }
33161 CONTROL_SYSTEM_STATE_DATA::ID => Some(Self::CONTROL_SYSTEM_STATE(
33162 CONTROL_SYSTEM_STATE_DATA::default(),
33163 )),
33164 CURRENT_EVENT_SEQUENCE_DATA::ID => Some(Self::CURRENT_EVENT_SEQUENCE(
33165 CURRENT_EVENT_SEQUENCE_DATA::default(),
33166 )),
33167 CURRENT_MODE_DATA::ID => Some(Self::CURRENT_MODE(CURRENT_MODE_DATA::default())),
33168 DATA_STREAM_DATA::ID => Some(Self::DATA_STREAM(DATA_STREAM_DATA::default())),
33169 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => Some(Self::DATA_TRANSMISSION_HANDSHAKE(
33170 DATA_TRANSMISSION_HANDSHAKE_DATA::default(),
33171 )),
33172 DEBUG_DATA::ID => Some(Self::DEBUG(DEBUG_DATA::default())),
33173 DEBUG_FLOAT_ARRAY_DATA::ID => {
33174 Some(Self::DEBUG_FLOAT_ARRAY(DEBUG_FLOAT_ARRAY_DATA::default()))
33175 }
33176 DEBUG_VECT_DATA::ID => Some(Self::DEBUG_VECT(DEBUG_VECT_DATA::default())),
33177 DISTANCE_SENSOR_DATA::ID => {
33178 Some(Self::DISTANCE_SENSOR(DISTANCE_SENSOR_DATA::default()))
33179 }
33180 EFI_STATUS_DATA::ID => Some(Self::EFI_STATUS(EFI_STATUS_DATA::default())),
33181 ENCAPSULATED_DATA_DATA::ID => {
33182 Some(Self::ENCAPSULATED_DATA(ENCAPSULATED_DATA_DATA::default()))
33183 }
33184 ESC_INFO_DATA::ID => Some(Self::ESC_INFO(ESC_INFO_DATA::default())),
33185 ESC_STATUS_DATA::ID => Some(Self::ESC_STATUS(ESC_STATUS_DATA::default())),
33186 ESTIMATOR_STATUS_DATA::ID => {
33187 Some(Self::ESTIMATOR_STATUS(ESTIMATOR_STATUS_DATA::default()))
33188 }
33189 EVENT_DATA::ID => Some(Self::EVENT(EVENT_DATA::default())),
33190 EXTENDED_SYS_STATE_DATA::ID => {
33191 Some(Self::EXTENDED_SYS_STATE(EXTENDED_SYS_STATE_DATA::default()))
33192 }
33193 FENCE_STATUS_DATA::ID => Some(Self::FENCE_STATUS(FENCE_STATUS_DATA::default())),
33194 FILE_TRANSFER_PROTOCOL_DATA::ID => Some(Self::FILE_TRANSFER_PROTOCOL(
33195 FILE_TRANSFER_PROTOCOL_DATA::default(),
33196 )),
33197 FLIGHT_INFORMATION_DATA::ID => {
33198 Some(Self::FLIGHT_INFORMATION(FLIGHT_INFORMATION_DATA::default()))
33199 }
33200 FOLLOW_TARGET_DATA::ID => Some(Self::FOLLOW_TARGET(FOLLOW_TARGET_DATA::default())),
33201 FUEL_STATUS_DATA::ID => Some(Self::FUEL_STATUS(FUEL_STATUS_DATA::default())),
33202 GENERATOR_STATUS_DATA::ID => {
33203 Some(Self::GENERATOR_STATUS(GENERATOR_STATUS_DATA::default()))
33204 }
33205 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => Some(Self::GIMBAL_DEVICE_ATTITUDE_STATUS(
33206 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::default(),
33207 )),
33208 GIMBAL_DEVICE_INFORMATION_DATA::ID => Some(Self::GIMBAL_DEVICE_INFORMATION(
33209 GIMBAL_DEVICE_INFORMATION_DATA::default(),
33210 )),
33211 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_DEVICE_SET_ATTITUDE(
33212 GIMBAL_DEVICE_SET_ATTITUDE_DATA::default(),
33213 )),
33214 GIMBAL_MANAGER_INFORMATION_DATA::ID => Some(Self::GIMBAL_MANAGER_INFORMATION(
33215 GIMBAL_MANAGER_INFORMATION_DATA::default(),
33216 )),
33217 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_ATTITUDE(
33218 GIMBAL_MANAGER_SET_ATTITUDE_DATA::default(),
33219 )),
33220 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
33221 Some(Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(
33222 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::default(),
33223 ))
33224 }
33225 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_PITCHYAW(
33226 GIMBAL_MANAGER_SET_PITCHYAW_DATA::default(),
33227 )),
33228 GIMBAL_MANAGER_STATUS_DATA::ID => Some(Self::GIMBAL_MANAGER_STATUS(
33229 GIMBAL_MANAGER_STATUS_DATA::default(),
33230 )),
33231 GLOBAL_POSITION_INT_DATA::ID => Some(Self::GLOBAL_POSITION_INT(
33232 GLOBAL_POSITION_INT_DATA::default(),
33233 )),
33234 GLOBAL_POSITION_INT_COV_DATA::ID => Some(Self::GLOBAL_POSITION_INT_COV(
33235 GLOBAL_POSITION_INT_COV_DATA::default(),
33236 )),
33237 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
33238 Some(Self::GLOBAL_VISION_POSITION_ESTIMATE(
33239 GLOBAL_VISION_POSITION_ESTIMATE_DATA::default(),
33240 ))
33241 }
33242 GPS2_RAW_DATA::ID => Some(Self::GPS2_RAW(GPS2_RAW_DATA::default())),
33243 GPS2_RTK_DATA::ID => Some(Self::GPS2_RTK(GPS2_RTK_DATA::default())),
33244 GPS_GLOBAL_ORIGIN_DATA::ID => {
33245 Some(Self::GPS_GLOBAL_ORIGIN(GPS_GLOBAL_ORIGIN_DATA::default()))
33246 }
33247 GPS_INJECT_DATA_DATA::ID => {
33248 Some(Self::GPS_INJECT_DATA(GPS_INJECT_DATA_DATA::default()))
33249 }
33250 GPS_INPUT_DATA::ID => Some(Self::GPS_INPUT(GPS_INPUT_DATA::default())),
33251 GPS_RAW_INT_DATA::ID => Some(Self::GPS_RAW_INT(GPS_RAW_INT_DATA::default())),
33252 GPS_RTCM_DATA_DATA::ID => Some(Self::GPS_RTCM_DATA(GPS_RTCM_DATA_DATA::default())),
33253 GPS_RTK_DATA::ID => Some(Self::GPS_RTK(GPS_RTK_DATA::default())),
33254 GPS_STATUS_DATA::ID => Some(Self::GPS_STATUS(GPS_STATUS_DATA::default())),
33255 HEARTBEAT_DATA::ID => Some(Self::HEARTBEAT(HEARTBEAT_DATA::default())),
33256 HIGHRES_IMU_DATA::ID => Some(Self::HIGHRES_IMU(HIGHRES_IMU_DATA::default())),
33257 HIGH_LATENCY_DATA::ID => Some(Self::HIGH_LATENCY(HIGH_LATENCY_DATA::default())),
33258 HIGH_LATENCY2_DATA::ID => Some(Self::HIGH_LATENCY2(HIGH_LATENCY2_DATA::default())),
33259 HIL_ACTUATOR_CONTROLS_DATA::ID => Some(Self::HIL_ACTUATOR_CONTROLS(
33260 HIL_ACTUATOR_CONTROLS_DATA::default(),
33261 )),
33262 HIL_CONTROLS_DATA::ID => Some(Self::HIL_CONTROLS(HIL_CONTROLS_DATA::default())),
33263 HIL_GPS_DATA::ID => Some(Self::HIL_GPS(HIL_GPS_DATA::default())),
33264 HIL_OPTICAL_FLOW_DATA::ID => {
33265 Some(Self::HIL_OPTICAL_FLOW(HIL_OPTICAL_FLOW_DATA::default()))
33266 }
33267 HIL_RC_INPUTS_RAW_DATA::ID => {
33268 Some(Self::HIL_RC_INPUTS_RAW(HIL_RC_INPUTS_RAW_DATA::default()))
33269 }
33270 HIL_SENSOR_DATA::ID => Some(Self::HIL_SENSOR(HIL_SENSOR_DATA::default())),
33271 HIL_STATE_DATA::ID => Some(Self::HIL_STATE(HIL_STATE_DATA::default())),
33272 HIL_STATE_QUATERNION_DATA::ID => Some(Self::HIL_STATE_QUATERNION(
33273 HIL_STATE_QUATERNION_DATA::default(),
33274 )),
33275 HOME_POSITION_DATA::ID => Some(Self::HOME_POSITION(HOME_POSITION_DATA::default())),
33276 HYGROMETER_SENSOR_DATA::ID => {
33277 Some(Self::HYGROMETER_SENSOR(HYGROMETER_SENSOR_DATA::default()))
33278 }
33279 ILLUMINATOR_STATUS_DATA::ID => {
33280 Some(Self::ILLUMINATOR_STATUS(ILLUMINATOR_STATUS_DATA::default()))
33281 }
33282 ISBD_LINK_STATUS_DATA::ID => {
33283 Some(Self::ISBD_LINK_STATUS(ISBD_LINK_STATUS_DATA::default()))
33284 }
33285 LANDING_TARGET_DATA::ID => Some(Self::LANDING_TARGET(LANDING_TARGET_DATA::default())),
33286 LINK_NODE_STATUS_DATA::ID => {
33287 Some(Self::LINK_NODE_STATUS(LINK_NODE_STATUS_DATA::default()))
33288 }
33289 LOCAL_POSITION_NED_DATA::ID => {
33290 Some(Self::LOCAL_POSITION_NED(LOCAL_POSITION_NED_DATA::default()))
33291 }
33292 LOCAL_POSITION_NED_COV_DATA::ID => Some(Self::LOCAL_POSITION_NED_COV(
33293 LOCAL_POSITION_NED_COV_DATA::default(),
33294 )),
33295 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
33296 Some(Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(
33297 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::default(),
33298 ))
33299 }
33300 LOGGING_ACK_DATA::ID => Some(Self::LOGGING_ACK(LOGGING_ACK_DATA::default())),
33301 LOGGING_DATA_DATA::ID => Some(Self::LOGGING_DATA(LOGGING_DATA_DATA::default())),
33302 LOGGING_DATA_ACKED_DATA::ID => {
33303 Some(Self::LOGGING_DATA_ACKED(LOGGING_DATA_ACKED_DATA::default()))
33304 }
33305 LOG_DATA_DATA::ID => Some(Self::LOG_DATA(LOG_DATA_DATA::default())),
33306 LOG_ENTRY_DATA::ID => Some(Self::LOG_ENTRY(LOG_ENTRY_DATA::default())),
33307 LOG_ERASE_DATA::ID => Some(Self::LOG_ERASE(LOG_ERASE_DATA::default())),
33308 LOG_REQUEST_DATA_DATA::ID => {
33309 Some(Self::LOG_REQUEST_DATA(LOG_REQUEST_DATA_DATA::default()))
33310 }
33311 LOG_REQUEST_END_DATA::ID => {
33312 Some(Self::LOG_REQUEST_END(LOG_REQUEST_END_DATA::default()))
33313 }
33314 LOG_REQUEST_LIST_DATA::ID => {
33315 Some(Self::LOG_REQUEST_LIST(LOG_REQUEST_LIST_DATA::default()))
33316 }
33317 MAG_CAL_REPORT_DATA::ID => Some(Self::MAG_CAL_REPORT(MAG_CAL_REPORT_DATA::default())),
33318 MANUAL_CONTROL_DATA::ID => Some(Self::MANUAL_CONTROL(MANUAL_CONTROL_DATA::default())),
33319 MANUAL_SETPOINT_DATA::ID => {
33320 Some(Self::MANUAL_SETPOINT(MANUAL_SETPOINT_DATA::default()))
33321 }
33322 MEMORY_VECT_DATA::ID => Some(Self::MEMORY_VECT(MEMORY_VECT_DATA::default())),
33323 MESSAGE_INTERVAL_DATA::ID => {
33324 Some(Self::MESSAGE_INTERVAL(MESSAGE_INTERVAL_DATA::default()))
33325 }
33326 MISSION_ACK_DATA::ID => Some(Self::MISSION_ACK(MISSION_ACK_DATA::default())),
33327 MISSION_CLEAR_ALL_DATA::ID => {
33328 Some(Self::MISSION_CLEAR_ALL(MISSION_CLEAR_ALL_DATA::default()))
33329 }
33330 MISSION_COUNT_DATA::ID => Some(Self::MISSION_COUNT(MISSION_COUNT_DATA::default())),
33331 MISSION_CURRENT_DATA::ID => {
33332 Some(Self::MISSION_CURRENT(MISSION_CURRENT_DATA::default()))
33333 }
33334 MISSION_ITEM_DATA::ID => Some(Self::MISSION_ITEM(MISSION_ITEM_DATA::default())),
33335 MISSION_ITEM_INT_DATA::ID => {
33336 Some(Self::MISSION_ITEM_INT(MISSION_ITEM_INT_DATA::default()))
33337 }
33338 MISSION_ITEM_REACHED_DATA::ID => Some(Self::MISSION_ITEM_REACHED(
33339 MISSION_ITEM_REACHED_DATA::default(),
33340 )),
33341 MISSION_REQUEST_DATA::ID => {
33342 Some(Self::MISSION_REQUEST(MISSION_REQUEST_DATA::default()))
33343 }
33344 MISSION_REQUEST_INT_DATA::ID => Some(Self::MISSION_REQUEST_INT(
33345 MISSION_REQUEST_INT_DATA::default(),
33346 )),
33347 MISSION_REQUEST_LIST_DATA::ID => Some(Self::MISSION_REQUEST_LIST(
33348 MISSION_REQUEST_LIST_DATA::default(),
33349 )),
33350 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_REQUEST_PARTIAL_LIST(
33351 MISSION_REQUEST_PARTIAL_LIST_DATA::default(),
33352 )),
33353 MISSION_SET_CURRENT_DATA::ID => Some(Self::MISSION_SET_CURRENT(
33354 MISSION_SET_CURRENT_DATA::default(),
33355 )),
33356 MISSION_WRITE_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_WRITE_PARTIAL_LIST(
33357 MISSION_WRITE_PARTIAL_LIST_DATA::default(),
33358 )),
33359 MOUNT_ORIENTATION_DATA::ID => {
33360 Some(Self::MOUNT_ORIENTATION(MOUNT_ORIENTATION_DATA::default()))
33361 }
33362 NAMED_VALUE_FLOAT_DATA::ID => {
33363 Some(Self::NAMED_VALUE_FLOAT(NAMED_VALUE_FLOAT_DATA::default()))
33364 }
33365 NAMED_VALUE_INT_DATA::ID => {
33366 Some(Self::NAMED_VALUE_INT(NAMED_VALUE_INT_DATA::default()))
33367 }
33368 NAV_CONTROLLER_OUTPUT_DATA::ID => Some(Self::NAV_CONTROLLER_OUTPUT(
33369 NAV_CONTROLLER_OUTPUT_DATA::default(),
33370 )),
33371 OBSTACLE_DISTANCE_DATA::ID => {
33372 Some(Self::OBSTACLE_DISTANCE(OBSTACLE_DISTANCE_DATA::default()))
33373 }
33374 ODOMETRY_DATA::ID => Some(Self::ODOMETRY(ODOMETRY_DATA::default())),
33375 ONBOARD_COMPUTER_STATUS_DATA::ID => Some(Self::ONBOARD_COMPUTER_STATUS(
33376 ONBOARD_COMPUTER_STATUS_DATA::default(),
33377 )),
33378 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => Some(Self::OPEN_DRONE_ID_ARM_STATUS(
33379 OPEN_DRONE_ID_ARM_STATUS_DATA::default(),
33380 )),
33381 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => Some(Self::OPEN_DRONE_ID_AUTHENTICATION(
33382 OPEN_DRONE_ID_AUTHENTICATION_DATA::default(),
33383 )),
33384 OPEN_DRONE_ID_BASIC_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_BASIC_ID(
33385 OPEN_DRONE_ID_BASIC_ID_DATA::default(),
33386 )),
33387 OPEN_DRONE_ID_LOCATION_DATA::ID => Some(Self::OPEN_DRONE_ID_LOCATION(
33388 OPEN_DRONE_ID_LOCATION_DATA::default(),
33389 )),
33390 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => Some(Self::OPEN_DRONE_ID_MESSAGE_PACK(
33391 OPEN_DRONE_ID_MESSAGE_PACK_DATA::default(),
33392 )),
33393 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_OPERATOR_ID(
33394 OPEN_DRONE_ID_OPERATOR_ID_DATA::default(),
33395 )),
33396 OPEN_DRONE_ID_SELF_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_SELF_ID(
33397 OPEN_DRONE_ID_SELF_ID_DATA::default(),
33398 )),
33399 OPEN_DRONE_ID_SYSTEM_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM(
33400 OPEN_DRONE_ID_SYSTEM_DATA::default(),
33401 )),
33402 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM_UPDATE(
33403 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::default(),
33404 )),
33405 OPTICAL_FLOW_DATA::ID => Some(Self::OPTICAL_FLOW(OPTICAL_FLOW_DATA::default())),
33406 OPTICAL_FLOW_RAD_DATA::ID => {
33407 Some(Self::OPTICAL_FLOW_RAD(OPTICAL_FLOW_RAD_DATA::default()))
33408 }
33409 ORBIT_EXECUTION_STATUS_DATA::ID => Some(Self::ORBIT_EXECUTION_STATUS(
33410 ORBIT_EXECUTION_STATUS_DATA::default(),
33411 )),
33412 PARAM_EXT_ACK_DATA::ID => Some(Self::PARAM_EXT_ACK(PARAM_EXT_ACK_DATA::default())),
33413 PARAM_EXT_REQUEST_LIST_DATA::ID => Some(Self::PARAM_EXT_REQUEST_LIST(
33414 PARAM_EXT_REQUEST_LIST_DATA::default(),
33415 )),
33416 PARAM_EXT_REQUEST_READ_DATA::ID => Some(Self::PARAM_EXT_REQUEST_READ(
33417 PARAM_EXT_REQUEST_READ_DATA::default(),
33418 )),
33419 PARAM_EXT_SET_DATA::ID => Some(Self::PARAM_EXT_SET(PARAM_EXT_SET_DATA::default())),
33420 PARAM_EXT_VALUE_DATA::ID => {
33421 Some(Self::PARAM_EXT_VALUE(PARAM_EXT_VALUE_DATA::default()))
33422 }
33423 PARAM_MAP_RC_DATA::ID => Some(Self::PARAM_MAP_RC(PARAM_MAP_RC_DATA::default())),
33424 PARAM_REQUEST_LIST_DATA::ID => {
33425 Some(Self::PARAM_REQUEST_LIST(PARAM_REQUEST_LIST_DATA::default()))
33426 }
33427 PARAM_REQUEST_READ_DATA::ID => {
33428 Some(Self::PARAM_REQUEST_READ(PARAM_REQUEST_READ_DATA::default()))
33429 }
33430 PARAM_SET_DATA::ID => Some(Self::PARAM_SET(PARAM_SET_DATA::default())),
33431 PARAM_VALUE_DATA::ID => Some(Self::PARAM_VALUE(PARAM_VALUE_DATA::default())),
33432 PING_DATA::ID => Some(Self::PING(PING_DATA::default())),
33433 PLAY_TUNE_DATA::ID => Some(Self::PLAY_TUNE(PLAY_TUNE_DATA::default())),
33434 PLAY_TUNE_V2_DATA::ID => Some(Self::PLAY_TUNE_V2(PLAY_TUNE_V2_DATA::default())),
33435 POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::POSITION_TARGET_GLOBAL_INT(
33436 POSITION_TARGET_GLOBAL_INT_DATA::default(),
33437 )),
33438 POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::POSITION_TARGET_LOCAL_NED(
33439 POSITION_TARGET_LOCAL_NED_DATA::default(),
33440 )),
33441 POWER_STATUS_DATA::ID => Some(Self::POWER_STATUS(POWER_STATUS_DATA::default())),
33442 PROTOCOL_VERSION_DATA::ID => {
33443 Some(Self::PROTOCOL_VERSION(PROTOCOL_VERSION_DATA::default()))
33444 }
33445 RADIO_STATUS_DATA::ID => Some(Self::RADIO_STATUS(RADIO_STATUS_DATA::default())),
33446 RAW_IMU_DATA::ID => Some(Self::RAW_IMU(RAW_IMU_DATA::default())),
33447 RAW_PRESSURE_DATA::ID => Some(Self::RAW_PRESSURE(RAW_PRESSURE_DATA::default())),
33448 RAW_RPM_DATA::ID => Some(Self::RAW_RPM(RAW_RPM_DATA::default())),
33449 RC_CHANNELS_DATA::ID => Some(Self::RC_CHANNELS(RC_CHANNELS_DATA::default())),
33450 RC_CHANNELS_OVERRIDE_DATA::ID => Some(Self::RC_CHANNELS_OVERRIDE(
33451 RC_CHANNELS_OVERRIDE_DATA::default(),
33452 )),
33453 RC_CHANNELS_RAW_DATA::ID => {
33454 Some(Self::RC_CHANNELS_RAW(RC_CHANNELS_RAW_DATA::default()))
33455 }
33456 RC_CHANNELS_SCALED_DATA::ID => {
33457 Some(Self::RC_CHANNELS_SCALED(RC_CHANNELS_SCALED_DATA::default()))
33458 }
33459 REQUEST_DATA_STREAM_DATA::ID => Some(Self::REQUEST_DATA_STREAM(
33460 REQUEST_DATA_STREAM_DATA::default(),
33461 )),
33462 REQUEST_EVENT_DATA::ID => Some(Self::REQUEST_EVENT(REQUEST_EVENT_DATA::default())),
33463 RESOURCE_REQUEST_DATA::ID => {
33464 Some(Self::RESOURCE_REQUEST(RESOURCE_REQUEST_DATA::default()))
33465 }
33466 RESPONSE_EVENT_ERROR_DATA::ID => Some(Self::RESPONSE_EVENT_ERROR(
33467 RESPONSE_EVENT_ERROR_DATA::default(),
33468 )),
33469 SAFETY_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_ALLOWED_AREA(
33470 SAFETY_ALLOWED_AREA_DATA::default(),
33471 )),
33472 SAFETY_SET_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_SET_ALLOWED_AREA(
33473 SAFETY_SET_ALLOWED_AREA_DATA::default(),
33474 )),
33475 SCALED_IMU_DATA::ID => Some(Self::SCALED_IMU(SCALED_IMU_DATA::default())),
33476 SCALED_IMU2_DATA::ID => Some(Self::SCALED_IMU2(SCALED_IMU2_DATA::default())),
33477 SCALED_IMU3_DATA::ID => Some(Self::SCALED_IMU3(SCALED_IMU3_DATA::default())),
33478 SCALED_PRESSURE_DATA::ID => {
33479 Some(Self::SCALED_PRESSURE(SCALED_PRESSURE_DATA::default()))
33480 }
33481 SCALED_PRESSURE2_DATA::ID => {
33482 Some(Self::SCALED_PRESSURE2(SCALED_PRESSURE2_DATA::default()))
33483 }
33484 SCALED_PRESSURE3_DATA::ID => {
33485 Some(Self::SCALED_PRESSURE3(SCALED_PRESSURE3_DATA::default()))
33486 }
33487 SCRIPT_COUNT_DATA::ID => Some(Self::SCRIPT_COUNT(SCRIPT_COUNT_DATA::default())),
33488 SCRIPT_CURRENT_DATA::ID => Some(Self::SCRIPT_CURRENT(SCRIPT_CURRENT_DATA::default())),
33489 SCRIPT_ITEM_DATA::ID => Some(Self::SCRIPT_ITEM(SCRIPT_ITEM_DATA::default())),
33490 SCRIPT_REQUEST_DATA::ID => Some(Self::SCRIPT_REQUEST(SCRIPT_REQUEST_DATA::default())),
33491 SCRIPT_REQUEST_LIST_DATA::ID => Some(Self::SCRIPT_REQUEST_LIST(
33492 SCRIPT_REQUEST_LIST_DATA::default(),
33493 )),
33494 SERIAL_CONTROL_DATA::ID => Some(Self::SERIAL_CONTROL(SERIAL_CONTROL_DATA::default())),
33495 SERVO_OUTPUT_RAW_DATA::ID => {
33496 Some(Self::SERVO_OUTPUT_RAW(SERVO_OUTPUT_RAW_DATA::default()))
33497 }
33498 SETUP_SIGNING_DATA::ID => Some(Self::SETUP_SIGNING(SETUP_SIGNING_DATA::default())),
33499 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::SET_ACTUATOR_CONTROL_TARGET(
33500 SET_ACTUATOR_CONTROL_TARGET_DATA::default(),
33501 )),
33502 SET_ATTITUDE_TARGET_DATA::ID => Some(Self::SET_ATTITUDE_TARGET(
33503 SET_ATTITUDE_TARGET_DATA::default(),
33504 )),
33505 SET_GPS_GLOBAL_ORIGIN_DATA::ID => Some(Self::SET_GPS_GLOBAL_ORIGIN(
33506 SET_GPS_GLOBAL_ORIGIN_DATA::default(),
33507 )),
33508 SET_HOME_POSITION_DATA::ID => {
33509 Some(Self::SET_HOME_POSITION(SET_HOME_POSITION_DATA::default()))
33510 }
33511 SET_MODE_DATA::ID => Some(Self::SET_MODE(SET_MODE_DATA::default())),
33512 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::SET_POSITION_TARGET_GLOBAL_INT(
33513 SET_POSITION_TARGET_GLOBAL_INT_DATA::default(),
33514 )),
33515 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::SET_POSITION_TARGET_LOCAL_NED(
33516 SET_POSITION_TARGET_LOCAL_NED_DATA::default(),
33517 )),
33518 SIM_STATE_DATA::ID => Some(Self::SIM_STATE(SIM_STATE_DATA::default())),
33519 SMART_BATTERY_INFO_DATA::ID => {
33520 Some(Self::SMART_BATTERY_INFO(SMART_BATTERY_INFO_DATA::default()))
33521 }
33522 STATUSTEXT_DATA::ID => Some(Self::STATUSTEXT(STATUSTEXT_DATA::default())),
33523 STORAGE_INFORMATION_DATA::ID => Some(Self::STORAGE_INFORMATION(
33524 STORAGE_INFORMATION_DATA::default(),
33525 )),
33526 SUPPORTED_TUNES_DATA::ID => {
33527 Some(Self::SUPPORTED_TUNES(SUPPORTED_TUNES_DATA::default()))
33528 }
33529 SYSTEM_TIME_DATA::ID => Some(Self::SYSTEM_TIME(SYSTEM_TIME_DATA::default())),
33530 SYS_STATUS_DATA::ID => Some(Self::SYS_STATUS(SYS_STATUS_DATA::default())),
33531 TERRAIN_CHECK_DATA::ID => Some(Self::TERRAIN_CHECK(TERRAIN_CHECK_DATA::default())),
33532 TERRAIN_DATA_DATA::ID => Some(Self::TERRAIN_DATA(TERRAIN_DATA_DATA::default())),
33533 TERRAIN_REPORT_DATA::ID => Some(Self::TERRAIN_REPORT(TERRAIN_REPORT_DATA::default())),
33534 TERRAIN_REQUEST_DATA::ID => {
33535 Some(Self::TERRAIN_REQUEST(TERRAIN_REQUEST_DATA::default()))
33536 }
33537 TIMESYNC_DATA::ID => Some(Self::TIMESYNC(TIMESYNC_DATA::default())),
33538 TIME_ESTIMATE_TO_TARGET_DATA::ID => Some(Self::TIME_ESTIMATE_TO_TARGET(
33539 TIME_ESTIMATE_TO_TARGET_DATA::default(),
33540 )),
33541 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
33542 Some(Self::TRAJECTORY_REPRESENTATION_BEZIER(
33543 TRAJECTORY_REPRESENTATION_BEZIER_DATA::default(),
33544 ))
33545 }
33546 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
33547 Some(Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(
33548 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::default(),
33549 ))
33550 }
33551 TUNNEL_DATA::ID => Some(Self::TUNNEL(TUNNEL_DATA::default())),
33552 UAVCAN_NODE_INFO_DATA::ID => {
33553 Some(Self::UAVCAN_NODE_INFO(UAVCAN_NODE_INFO_DATA::default()))
33554 }
33555 UAVCAN_NODE_STATUS_DATA::ID => {
33556 Some(Self::UAVCAN_NODE_STATUS(UAVCAN_NODE_STATUS_DATA::default()))
33557 }
33558 UTM_GLOBAL_POSITION_DATA::ID => Some(Self::UTM_GLOBAL_POSITION(
33559 UTM_GLOBAL_POSITION_DATA::default(),
33560 )),
33561 V2_EXTENSION_DATA::ID => Some(Self::V2_EXTENSION(V2_EXTENSION_DATA::default())),
33562 VFR_HUD_DATA::ID => Some(Self::VFR_HUD(VFR_HUD_DATA::default())),
33563 VIBRATION_DATA::ID => Some(Self::VIBRATION(VIBRATION_DATA::default())),
33564 VICON_POSITION_ESTIMATE_DATA::ID => Some(Self::VICON_POSITION_ESTIMATE(
33565 VICON_POSITION_ESTIMATE_DATA::default(),
33566 )),
33567 VIDEO_STREAM_INFORMATION_DATA::ID => Some(Self::VIDEO_STREAM_INFORMATION(
33568 VIDEO_STREAM_INFORMATION_DATA::default(),
33569 )),
33570 VIDEO_STREAM_STATUS_DATA::ID => Some(Self::VIDEO_STREAM_STATUS(
33571 VIDEO_STREAM_STATUS_DATA::default(),
33572 )),
33573 VISION_POSITION_ESTIMATE_DATA::ID => Some(Self::VISION_POSITION_ESTIMATE(
33574 VISION_POSITION_ESTIMATE_DATA::default(),
33575 )),
33576 VISION_SPEED_ESTIMATE_DATA::ID => Some(Self::VISION_SPEED_ESTIMATE(
33577 VISION_SPEED_ESTIMATE_DATA::default(),
33578 )),
33579 WHEEL_DISTANCE_DATA::ID => Some(Self::WHEEL_DISTANCE(WHEEL_DISTANCE_DATA::default())),
33580 WIFI_CONFIG_AP_DATA::ID => Some(Self::WIFI_CONFIG_AP(WIFI_CONFIG_AP_DATA::default())),
33581 WINCH_STATUS_DATA::ID => Some(Self::WINCH_STATUS(WINCH_STATUS_DATA::default())),
33582 WIND_COV_DATA::ID => Some(Self::WIND_COV(WIND_COV_DATA::default())),
33583 _ => None,
33584 }
33585 }
33586 #[cfg(feature = "arbitrary")]
33587 fn random_message_from_id<R: rand::RngCore>(id: u32, rng: &mut R) -> Option<Self> {
33588 match id {
33589 ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::ACTUATOR_CONTROL_TARGET(
33590 ACTUATOR_CONTROL_TARGET_DATA::random(rng),
33591 )),
33592 ACTUATOR_OUTPUT_STATUS_DATA::ID => Some(Self::ACTUATOR_OUTPUT_STATUS(
33593 ACTUATOR_OUTPUT_STATUS_DATA::random(rng),
33594 )),
33595 ADSB_VEHICLE_DATA::ID => Some(Self::ADSB_VEHICLE(ADSB_VEHICLE_DATA::random(rng))),
33596 AIS_VESSEL_DATA::ID => Some(Self::AIS_VESSEL(AIS_VESSEL_DATA::random(rng))),
33597 ALTITUDE_DATA::ID => Some(Self::ALTITUDE(ALTITUDE_DATA::random(rng))),
33598 ATTITUDE_DATA::ID => Some(Self::ATTITUDE(ATTITUDE_DATA::random(rng))),
33599 ATTITUDE_QUATERNION_DATA::ID => Some(Self::ATTITUDE_QUATERNION(
33600 ATTITUDE_QUATERNION_DATA::random(rng),
33601 )),
33602 ATTITUDE_QUATERNION_COV_DATA::ID => Some(Self::ATTITUDE_QUATERNION_COV(
33603 ATTITUDE_QUATERNION_COV_DATA::random(rng),
33604 )),
33605 ATTITUDE_TARGET_DATA::ID => {
33606 Some(Self::ATTITUDE_TARGET(ATTITUDE_TARGET_DATA::random(rng)))
33607 }
33608 ATT_POS_MOCAP_DATA::ID => Some(Self::ATT_POS_MOCAP(ATT_POS_MOCAP_DATA::random(rng))),
33609 AUTH_KEY_DATA::ID => Some(Self::AUTH_KEY(AUTH_KEY_DATA::random(rng))),
33610 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
33611 Some(Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(
33612 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::random(rng),
33613 ))
33614 }
33615 AUTOPILOT_VERSION_DATA::ID => {
33616 Some(Self::AUTOPILOT_VERSION(AUTOPILOT_VERSION_DATA::random(rng)))
33617 }
33618 AVAILABLE_MODES_DATA::ID => {
33619 Some(Self::AVAILABLE_MODES(AVAILABLE_MODES_DATA::random(rng)))
33620 }
33621 AVAILABLE_MODES_MONITOR_DATA::ID => Some(Self::AVAILABLE_MODES_MONITOR(
33622 AVAILABLE_MODES_MONITOR_DATA::random(rng),
33623 )),
33624 BATTERY_INFO_DATA::ID => Some(Self::BATTERY_INFO(BATTERY_INFO_DATA::random(rng))),
33625 BATTERY_STATUS_DATA::ID => Some(Self::BATTERY_STATUS(BATTERY_STATUS_DATA::random(rng))),
33626 BUTTON_CHANGE_DATA::ID => Some(Self::BUTTON_CHANGE(BUTTON_CHANGE_DATA::random(rng))),
33627 CAMERA_CAPTURE_STATUS_DATA::ID => Some(Self::CAMERA_CAPTURE_STATUS(
33628 CAMERA_CAPTURE_STATUS_DATA::random(rng),
33629 )),
33630 CAMERA_FOV_STATUS_DATA::ID => {
33631 Some(Self::CAMERA_FOV_STATUS(CAMERA_FOV_STATUS_DATA::random(rng)))
33632 }
33633 CAMERA_IMAGE_CAPTURED_DATA::ID => Some(Self::CAMERA_IMAGE_CAPTURED(
33634 CAMERA_IMAGE_CAPTURED_DATA::random(rng),
33635 )),
33636 CAMERA_INFORMATION_DATA::ID => Some(Self::CAMERA_INFORMATION(
33637 CAMERA_INFORMATION_DATA::random(rng),
33638 )),
33639 CAMERA_SETTINGS_DATA::ID => {
33640 Some(Self::CAMERA_SETTINGS(CAMERA_SETTINGS_DATA::random(rng)))
33641 }
33642 CAMERA_THERMAL_RANGE_DATA::ID => Some(Self::CAMERA_THERMAL_RANGE(
33643 CAMERA_THERMAL_RANGE_DATA::random(rng),
33644 )),
33645 CAMERA_TRACKING_GEO_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_GEO_STATUS(
33646 CAMERA_TRACKING_GEO_STATUS_DATA::random(rng),
33647 )),
33648 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_IMAGE_STATUS(
33649 CAMERA_TRACKING_IMAGE_STATUS_DATA::random(rng),
33650 )),
33651 CAMERA_TRIGGER_DATA::ID => Some(Self::CAMERA_TRIGGER(CAMERA_TRIGGER_DATA::random(rng))),
33652 CANFD_FRAME_DATA::ID => Some(Self::CANFD_FRAME(CANFD_FRAME_DATA::random(rng))),
33653 CAN_FILTER_MODIFY_DATA::ID => {
33654 Some(Self::CAN_FILTER_MODIFY(CAN_FILTER_MODIFY_DATA::random(rng)))
33655 }
33656 CAN_FRAME_DATA::ID => Some(Self::CAN_FRAME(CAN_FRAME_DATA::random(rng))),
33657 CELLULAR_CONFIG_DATA::ID => {
33658 Some(Self::CELLULAR_CONFIG(CELLULAR_CONFIG_DATA::random(rng)))
33659 }
33660 CELLULAR_STATUS_DATA::ID => {
33661 Some(Self::CELLULAR_STATUS(CELLULAR_STATUS_DATA::random(rng)))
33662 }
33663 CHANGE_OPERATOR_CONTROL_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL(
33664 CHANGE_OPERATOR_CONTROL_DATA::random(rng),
33665 )),
33666 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL_ACK(
33667 CHANGE_OPERATOR_CONTROL_ACK_DATA::random(rng),
33668 )),
33669 COLLISION_DATA::ID => Some(Self::COLLISION(COLLISION_DATA::random(rng))),
33670 COMMAND_ACK_DATA::ID => Some(Self::COMMAND_ACK(COMMAND_ACK_DATA::random(rng))),
33671 COMMAND_CANCEL_DATA::ID => Some(Self::COMMAND_CANCEL(COMMAND_CANCEL_DATA::random(rng))),
33672 COMMAND_INT_DATA::ID => Some(Self::COMMAND_INT(COMMAND_INT_DATA::random(rng))),
33673 COMMAND_LONG_DATA::ID => Some(Self::COMMAND_LONG(COMMAND_LONG_DATA::random(rng))),
33674 COMPONENT_INFORMATION_DATA::ID => Some(Self::COMPONENT_INFORMATION(
33675 COMPONENT_INFORMATION_DATA::random(rng),
33676 )),
33677 COMPONENT_INFORMATION_BASIC_DATA::ID => Some(Self::COMPONENT_INFORMATION_BASIC(
33678 COMPONENT_INFORMATION_BASIC_DATA::random(rng),
33679 )),
33680 COMPONENT_METADATA_DATA::ID => Some(Self::COMPONENT_METADATA(
33681 COMPONENT_METADATA_DATA::random(rng),
33682 )),
33683 CONTROL_SYSTEM_STATE_DATA::ID => Some(Self::CONTROL_SYSTEM_STATE(
33684 CONTROL_SYSTEM_STATE_DATA::random(rng),
33685 )),
33686 CURRENT_EVENT_SEQUENCE_DATA::ID => Some(Self::CURRENT_EVENT_SEQUENCE(
33687 CURRENT_EVENT_SEQUENCE_DATA::random(rng),
33688 )),
33689 CURRENT_MODE_DATA::ID => Some(Self::CURRENT_MODE(CURRENT_MODE_DATA::random(rng))),
33690 DATA_STREAM_DATA::ID => Some(Self::DATA_STREAM(DATA_STREAM_DATA::random(rng))),
33691 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => Some(Self::DATA_TRANSMISSION_HANDSHAKE(
33692 DATA_TRANSMISSION_HANDSHAKE_DATA::random(rng),
33693 )),
33694 DEBUG_DATA::ID => Some(Self::DEBUG(DEBUG_DATA::random(rng))),
33695 DEBUG_FLOAT_ARRAY_DATA::ID => {
33696 Some(Self::DEBUG_FLOAT_ARRAY(DEBUG_FLOAT_ARRAY_DATA::random(rng)))
33697 }
33698 DEBUG_VECT_DATA::ID => Some(Self::DEBUG_VECT(DEBUG_VECT_DATA::random(rng))),
33699 DISTANCE_SENSOR_DATA::ID => {
33700 Some(Self::DISTANCE_SENSOR(DISTANCE_SENSOR_DATA::random(rng)))
33701 }
33702 EFI_STATUS_DATA::ID => Some(Self::EFI_STATUS(EFI_STATUS_DATA::random(rng))),
33703 ENCAPSULATED_DATA_DATA::ID => {
33704 Some(Self::ENCAPSULATED_DATA(ENCAPSULATED_DATA_DATA::random(rng)))
33705 }
33706 ESC_INFO_DATA::ID => Some(Self::ESC_INFO(ESC_INFO_DATA::random(rng))),
33707 ESC_STATUS_DATA::ID => Some(Self::ESC_STATUS(ESC_STATUS_DATA::random(rng))),
33708 ESTIMATOR_STATUS_DATA::ID => {
33709 Some(Self::ESTIMATOR_STATUS(ESTIMATOR_STATUS_DATA::random(rng)))
33710 }
33711 EVENT_DATA::ID => Some(Self::EVENT(EVENT_DATA::random(rng))),
33712 EXTENDED_SYS_STATE_DATA::ID => Some(Self::EXTENDED_SYS_STATE(
33713 EXTENDED_SYS_STATE_DATA::random(rng),
33714 )),
33715 FENCE_STATUS_DATA::ID => Some(Self::FENCE_STATUS(FENCE_STATUS_DATA::random(rng))),
33716 FILE_TRANSFER_PROTOCOL_DATA::ID => Some(Self::FILE_TRANSFER_PROTOCOL(
33717 FILE_TRANSFER_PROTOCOL_DATA::random(rng),
33718 )),
33719 FLIGHT_INFORMATION_DATA::ID => Some(Self::FLIGHT_INFORMATION(
33720 FLIGHT_INFORMATION_DATA::random(rng),
33721 )),
33722 FOLLOW_TARGET_DATA::ID => Some(Self::FOLLOW_TARGET(FOLLOW_TARGET_DATA::random(rng))),
33723 FUEL_STATUS_DATA::ID => Some(Self::FUEL_STATUS(FUEL_STATUS_DATA::random(rng))),
33724 GENERATOR_STATUS_DATA::ID => {
33725 Some(Self::GENERATOR_STATUS(GENERATOR_STATUS_DATA::random(rng)))
33726 }
33727 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => Some(Self::GIMBAL_DEVICE_ATTITUDE_STATUS(
33728 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::random(rng),
33729 )),
33730 GIMBAL_DEVICE_INFORMATION_DATA::ID => Some(Self::GIMBAL_DEVICE_INFORMATION(
33731 GIMBAL_DEVICE_INFORMATION_DATA::random(rng),
33732 )),
33733 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_DEVICE_SET_ATTITUDE(
33734 GIMBAL_DEVICE_SET_ATTITUDE_DATA::random(rng),
33735 )),
33736 GIMBAL_MANAGER_INFORMATION_DATA::ID => Some(Self::GIMBAL_MANAGER_INFORMATION(
33737 GIMBAL_MANAGER_INFORMATION_DATA::random(rng),
33738 )),
33739 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_ATTITUDE(
33740 GIMBAL_MANAGER_SET_ATTITUDE_DATA::random(rng),
33741 )),
33742 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
33743 Some(Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(
33744 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::random(rng),
33745 ))
33746 }
33747 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_PITCHYAW(
33748 GIMBAL_MANAGER_SET_PITCHYAW_DATA::random(rng),
33749 )),
33750 GIMBAL_MANAGER_STATUS_DATA::ID => Some(Self::GIMBAL_MANAGER_STATUS(
33751 GIMBAL_MANAGER_STATUS_DATA::random(rng),
33752 )),
33753 GLOBAL_POSITION_INT_DATA::ID => Some(Self::GLOBAL_POSITION_INT(
33754 GLOBAL_POSITION_INT_DATA::random(rng),
33755 )),
33756 GLOBAL_POSITION_INT_COV_DATA::ID => Some(Self::GLOBAL_POSITION_INT_COV(
33757 GLOBAL_POSITION_INT_COV_DATA::random(rng),
33758 )),
33759 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
33760 Some(Self::GLOBAL_VISION_POSITION_ESTIMATE(
33761 GLOBAL_VISION_POSITION_ESTIMATE_DATA::random(rng),
33762 ))
33763 }
33764 GPS2_RAW_DATA::ID => Some(Self::GPS2_RAW(GPS2_RAW_DATA::random(rng))),
33765 GPS2_RTK_DATA::ID => Some(Self::GPS2_RTK(GPS2_RTK_DATA::random(rng))),
33766 GPS_GLOBAL_ORIGIN_DATA::ID => {
33767 Some(Self::GPS_GLOBAL_ORIGIN(GPS_GLOBAL_ORIGIN_DATA::random(rng)))
33768 }
33769 GPS_INJECT_DATA_DATA::ID => {
33770 Some(Self::GPS_INJECT_DATA(GPS_INJECT_DATA_DATA::random(rng)))
33771 }
33772 GPS_INPUT_DATA::ID => Some(Self::GPS_INPUT(GPS_INPUT_DATA::random(rng))),
33773 GPS_RAW_INT_DATA::ID => Some(Self::GPS_RAW_INT(GPS_RAW_INT_DATA::random(rng))),
33774 GPS_RTCM_DATA_DATA::ID => Some(Self::GPS_RTCM_DATA(GPS_RTCM_DATA_DATA::random(rng))),
33775 GPS_RTK_DATA::ID => Some(Self::GPS_RTK(GPS_RTK_DATA::random(rng))),
33776 GPS_STATUS_DATA::ID => Some(Self::GPS_STATUS(GPS_STATUS_DATA::random(rng))),
33777 HEARTBEAT_DATA::ID => Some(Self::HEARTBEAT(HEARTBEAT_DATA::random(rng))),
33778 HIGHRES_IMU_DATA::ID => Some(Self::HIGHRES_IMU(HIGHRES_IMU_DATA::random(rng))),
33779 HIGH_LATENCY_DATA::ID => Some(Self::HIGH_LATENCY(HIGH_LATENCY_DATA::random(rng))),
33780 HIGH_LATENCY2_DATA::ID => Some(Self::HIGH_LATENCY2(HIGH_LATENCY2_DATA::random(rng))),
33781 HIL_ACTUATOR_CONTROLS_DATA::ID => Some(Self::HIL_ACTUATOR_CONTROLS(
33782 HIL_ACTUATOR_CONTROLS_DATA::random(rng),
33783 )),
33784 HIL_CONTROLS_DATA::ID => Some(Self::HIL_CONTROLS(HIL_CONTROLS_DATA::random(rng))),
33785 HIL_GPS_DATA::ID => Some(Self::HIL_GPS(HIL_GPS_DATA::random(rng))),
33786 HIL_OPTICAL_FLOW_DATA::ID => {
33787 Some(Self::HIL_OPTICAL_FLOW(HIL_OPTICAL_FLOW_DATA::random(rng)))
33788 }
33789 HIL_RC_INPUTS_RAW_DATA::ID => {
33790 Some(Self::HIL_RC_INPUTS_RAW(HIL_RC_INPUTS_RAW_DATA::random(rng)))
33791 }
33792 HIL_SENSOR_DATA::ID => Some(Self::HIL_SENSOR(HIL_SENSOR_DATA::random(rng))),
33793 HIL_STATE_DATA::ID => Some(Self::HIL_STATE(HIL_STATE_DATA::random(rng))),
33794 HIL_STATE_QUATERNION_DATA::ID => Some(Self::HIL_STATE_QUATERNION(
33795 HIL_STATE_QUATERNION_DATA::random(rng),
33796 )),
33797 HOME_POSITION_DATA::ID => Some(Self::HOME_POSITION(HOME_POSITION_DATA::random(rng))),
33798 HYGROMETER_SENSOR_DATA::ID => {
33799 Some(Self::HYGROMETER_SENSOR(HYGROMETER_SENSOR_DATA::random(rng)))
33800 }
33801 ILLUMINATOR_STATUS_DATA::ID => Some(Self::ILLUMINATOR_STATUS(
33802 ILLUMINATOR_STATUS_DATA::random(rng),
33803 )),
33804 ISBD_LINK_STATUS_DATA::ID => {
33805 Some(Self::ISBD_LINK_STATUS(ISBD_LINK_STATUS_DATA::random(rng)))
33806 }
33807 LANDING_TARGET_DATA::ID => Some(Self::LANDING_TARGET(LANDING_TARGET_DATA::random(rng))),
33808 LINK_NODE_STATUS_DATA::ID => {
33809 Some(Self::LINK_NODE_STATUS(LINK_NODE_STATUS_DATA::random(rng)))
33810 }
33811 LOCAL_POSITION_NED_DATA::ID => Some(Self::LOCAL_POSITION_NED(
33812 LOCAL_POSITION_NED_DATA::random(rng),
33813 )),
33814 LOCAL_POSITION_NED_COV_DATA::ID => Some(Self::LOCAL_POSITION_NED_COV(
33815 LOCAL_POSITION_NED_COV_DATA::random(rng),
33816 )),
33817 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
33818 Some(Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(
33819 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::random(rng),
33820 ))
33821 }
33822 LOGGING_ACK_DATA::ID => Some(Self::LOGGING_ACK(LOGGING_ACK_DATA::random(rng))),
33823 LOGGING_DATA_DATA::ID => Some(Self::LOGGING_DATA(LOGGING_DATA_DATA::random(rng))),
33824 LOGGING_DATA_ACKED_DATA::ID => Some(Self::LOGGING_DATA_ACKED(
33825 LOGGING_DATA_ACKED_DATA::random(rng),
33826 )),
33827 LOG_DATA_DATA::ID => Some(Self::LOG_DATA(LOG_DATA_DATA::random(rng))),
33828 LOG_ENTRY_DATA::ID => Some(Self::LOG_ENTRY(LOG_ENTRY_DATA::random(rng))),
33829 LOG_ERASE_DATA::ID => Some(Self::LOG_ERASE(LOG_ERASE_DATA::random(rng))),
33830 LOG_REQUEST_DATA_DATA::ID => {
33831 Some(Self::LOG_REQUEST_DATA(LOG_REQUEST_DATA_DATA::random(rng)))
33832 }
33833 LOG_REQUEST_END_DATA::ID => {
33834 Some(Self::LOG_REQUEST_END(LOG_REQUEST_END_DATA::random(rng)))
33835 }
33836 LOG_REQUEST_LIST_DATA::ID => {
33837 Some(Self::LOG_REQUEST_LIST(LOG_REQUEST_LIST_DATA::random(rng)))
33838 }
33839 MAG_CAL_REPORT_DATA::ID => Some(Self::MAG_CAL_REPORT(MAG_CAL_REPORT_DATA::random(rng))),
33840 MANUAL_CONTROL_DATA::ID => Some(Self::MANUAL_CONTROL(MANUAL_CONTROL_DATA::random(rng))),
33841 MANUAL_SETPOINT_DATA::ID => {
33842 Some(Self::MANUAL_SETPOINT(MANUAL_SETPOINT_DATA::random(rng)))
33843 }
33844 MEMORY_VECT_DATA::ID => Some(Self::MEMORY_VECT(MEMORY_VECT_DATA::random(rng))),
33845 MESSAGE_INTERVAL_DATA::ID => {
33846 Some(Self::MESSAGE_INTERVAL(MESSAGE_INTERVAL_DATA::random(rng)))
33847 }
33848 MISSION_ACK_DATA::ID => Some(Self::MISSION_ACK(MISSION_ACK_DATA::random(rng))),
33849 MISSION_CLEAR_ALL_DATA::ID => {
33850 Some(Self::MISSION_CLEAR_ALL(MISSION_CLEAR_ALL_DATA::random(rng)))
33851 }
33852 MISSION_COUNT_DATA::ID => Some(Self::MISSION_COUNT(MISSION_COUNT_DATA::random(rng))),
33853 MISSION_CURRENT_DATA::ID => {
33854 Some(Self::MISSION_CURRENT(MISSION_CURRENT_DATA::random(rng)))
33855 }
33856 MISSION_ITEM_DATA::ID => Some(Self::MISSION_ITEM(MISSION_ITEM_DATA::random(rng))),
33857 MISSION_ITEM_INT_DATA::ID => {
33858 Some(Self::MISSION_ITEM_INT(MISSION_ITEM_INT_DATA::random(rng)))
33859 }
33860 MISSION_ITEM_REACHED_DATA::ID => Some(Self::MISSION_ITEM_REACHED(
33861 MISSION_ITEM_REACHED_DATA::random(rng),
33862 )),
33863 MISSION_REQUEST_DATA::ID => {
33864 Some(Self::MISSION_REQUEST(MISSION_REQUEST_DATA::random(rng)))
33865 }
33866 MISSION_REQUEST_INT_DATA::ID => Some(Self::MISSION_REQUEST_INT(
33867 MISSION_REQUEST_INT_DATA::random(rng),
33868 )),
33869 MISSION_REQUEST_LIST_DATA::ID => Some(Self::MISSION_REQUEST_LIST(
33870 MISSION_REQUEST_LIST_DATA::random(rng),
33871 )),
33872 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_REQUEST_PARTIAL_LIST(
33873 MISSION_REQUEST_PARTIAL_LIST_DATA::random(rng),
33874 )),
33875 MISSION_SET_CURRENT_DATA::ID => Some(Self::MISSION_SET_CURRENT(
33876 MISSION_SET_CURRENT_DATA::random(rng),
33877 )),
33878 MISSION_WRITE_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_WRITE_PARTIAL_LIST(
33879 MISSION_WRITE_PARTIAL_LIST_DATA::random(rng),
33880 )),
33881 MOUNT_ORIENTATION_DATA::ID => {
33882 Some(Self::MOUNT_ORIENTATION(MOUNT_ORIENTATION_DATA::random(rng)))
33883 }
33884 NAMED_VALUE_FLOAT_DATA::ID => {
33885 Some(Self::NAMED_VALUE_FLOAT(NAMED_VALUE_FLOAT_DATA::random(rng)))
33886 }
33887 NAMED_VALUE_INT_DATA::ID => {
33888 Some(Self::NAMED_VALUE_INT(NAMED_VALUE_INT_DATA::random(rng)))
33889 }
33890 NAV_CONTROLLER_OUTPUT_DATA::ID => Some(Self::NAV_CONTROLLER_OUTPUT(
33891 NAV_CONTROLLER_OUTPUT_DATA::random(rng),
33892 )),
33893 OBSTACLE_DISTANCE_DATA::ID => {
33894 Some(Self::OBSTACLE_DISTANCE(OBSTACLE_DISTANCE_DATA::random(rng)))
33895 }
33896 ODOMETRY_DATA::ID => Some(Self::ODOMETRY(ODOMETRY_DATA::random(rng))),
33897 ONBOARD_COMPUTER_STATUS_DATA::ID => Some(Self::ONBOARD_COMPUTER_STATUS(
33898 ONBOARD_COMPUTER_STATUS_DATA::random(rng),
33899 )),
33900 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => Some(Self::OPEN_DRONE_ID_ARM_STATUS(
33901 OPEN_DRONE_ID_ARM_STATUS_DATA::random(rng),
33902 )),
33903 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => Some(Self::OPEN_DRONE_ID_AUTHENTICATION(
33904 OPEN_DRONE_ID_AUTHENTICATION_DATA::random(rng),
33905 )),
33906 OPEN_DRONE_ID_BASIC_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_BASIC_ID(
33907 OPEN_DRONE_ID_BASIC_ID_DATA::random(rng),
33908 )),
33909 OPEN_DRONE_ID_LOCATION_DATA::ID => Some(Self::OPEN_DRONE_ID_LOCATION(
33910 OPEN_DRONE_ID_LOCATION_DATA::random(rng),
33911 )),
33912 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => Some(Self::OPEN_DRONE_ID_MESSAGE_PACK(
33913 OPEN_DRONE_ID_MESSAGE_PACK_DATA::random(rng),
33914 )),
33915 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_OPERATOR_ID(
33916 OPEN_DRONE_ID_OPERATOR_ID_DATA::random(rng),
33917 )),
33918 OPEN_DRONE_ID_SELF_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_SELF_ID(
33919 OPEN_DRONE_ID_SELF_ID_DATA::random(rng),
33920 )),
33921 OPEN_DRONE_ID_SYSTEM_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM(
33922 OPEN_DRONE_ID_SYSTEM_DATA::random(rng),
33923 )),
33924 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM_UPDATE(
33925 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::random(rng),
33926 )),
33927 OPTICAL_FLOW_DATA::ID => Some(Self::OPTICAL_FLOW(OPTICAL_FLOW_DATA::random(rng))),
33928 OPTICAL_FLOW_RAD_DATA::ID => {
33929 Some(Self::OPTICAL_FLOW_RAD(OPTICAL_FLOW_RAD_DATA::random(rng)))
33930 }
33931 ORBIT_EXECUTION_STATUS_DATA::ID => Some(Self::ORBIT_EXECUTION_STATUS(
33932 ORBIT_EXECUTION_STATUS_DATA::random(rng),
33933 )),
33934 PARAM_EXT_ACK_DATA::ID => Some(Self::PARAM_EXT_ACK(PARAM_EXT_ACK_DATA::random(rng))),
33935 PARAM_EXT_REQUEST_LIST_DATA::ID => Some(Self::PARAM_EXT_REQUEST_LIST(
33936 PARAM_EXT_REQUEST_LIST_DATA::random(rng),
33937 )),
33938 PARAM_EXT_REQUEST_READ_DATA::ID => Some(Self::PARAM_EXT_REQUEST_READ(
33939 PARAM_EXT_REQUEST_READ_DATA::random(rng),
33940 )),
33941 PARAM_EXT_SET_DATA::ID => Some(Self::PARAM_EXT_SET(PARAM_EXT_SET_DATA::random(rng))),
33942 PARAM_EXT_VALUE_DATA::ID => {
33943 Some(Self::PARAM_EXT_VALUE(PARAM_EXT_VALUE_DATA::random(rng)))
33944 }
33945 PARAM_MAP_RC_DATA::ID => Some(Self::PARAM_MAP_RC(PARAM_MAP_RC_DATA::random(rng))),
33946 PARAM_REQUEST_LIST_DATA::ID => Some(Self::PARAM_REQUEST_LIST(
33947 PARAM_REQUEST_LIST_DATA::random(rng),
33948 )),
33949 PARAM_REQUEST_READ_DATA::ID => Some(Self::PARAM_REQUEST_READ(
33950 PARAM_REQUEST_READ_DATA::random(rng),
33951 )),
33952 PARAM_SET_DATA::ID => Some(Self::PARAM_SET(PARAM_SET_DATA::random(rng))),
33953 PARAM_VALUE_DATA::ID => Some(Self::PARAM_VALUE(PARAM_VALUE_DATA::random(rng))),
33954 PING_DATA::ID => Some(Self::PING(PING_DATA::random(rng))),
33955 PLAY_TUNE_DATA::ID => Some(Self::PLAY_TUNE(PLAY_TUNE_DATA::random(rng))),
33956 PLAY_TUNE_V2_DATA::ID => Some(Self::PLAY_TUNE_V2(PLAY_TUNE_V2_DATA::random(rng))),
33957 POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::POSITION_TARGET_GLOBAL_INT(
33958 POSITION_TARGET_GLOBAL_INT_DATA::random(rng),
33959 )),
33960 POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::POSITION_TARGET_LOCAL_NED(
33961 POSITION_TARGET_LOCAL_NED_DATA::random(rng),
33962 )),
33963 POWER_STATUS_DATA::ID => Some(Self::POWER_STATUS(POWER_STATUS_DATA::random(rng))),
33964 PROTOCOL_VERSION_DATA::ID => {
33965 Some(Self::PROTOCOL_VERSION(PROTOCOL_VERSION_DATA::random(rng)))
33966 }
33967 RADIO_STATUS_DATA::ID => Some(Self::RADIO_STATUS(RADIO_STATUS_DATA::random(rng))),
33968 RAW_IMU_DATA::ID => Some(Self::RAW_IMU(RAW_IMU_DATA::random(rng))),
33969 RAW_PRESSURE_DATA::ID => Some(Self::RAW_PRESSURE(RAW_PRESSURE_DATA::random(rng))),
33970 RAW_RPM_DATA::ID => Some(Self::RAW_RPM(RAW_RPM_DATA::random(rng))),
33971 RC_CHANNELS_DATA::ID => Some(Self::RC_CHANNELS(RC_CHANNELS_DATA::random(rng))),
33972 RC_CHANNELS_OVERRIDE_DATA::ID => Some(Self::RC_CHANNELS_OVERRIDE(
33973 RC_CHANNELS_OVERRIDE_DATA::random(rng),
33974 )),
33975 RC_CHANNELS_RAW_DATA::ID => {
33976 Some(Self::RC_CHANNELS_RAW(RC_CHANNELS_RAW_DATA::random(rng)))
33977 }
33978 RC_CHANNELS_SCALED_DATA::ID => Some(Self::RC_CHANNELS_SCALED(
33979 RC_CHANNELS_SCALED_DATA::random(rng),
33980 )),
33981 REQUEST_DATA_STREAM_DATA::ID => Some(Self::REQUEST_DATA_STREAM(
33982 REQUEST_DATA_STREAM_DATA::random(rng),
33983 )),
33984 REQUEST_EVENT_DATA::ID => Some(Self::REQUEST_EVENT(REQUEST_EVENT_DATA::random(rng))),
33985 RESOURCE_REQUEST_DATA::ID => {
33986 Some(Self::RESOURCE_REQUEST(RESOURCE_REQUEST_DATA::random(rng)))
33987 }
33988 RESPONSE_EVENT_ERROR_DATA::ID => Some(Self::RESPONSE_EVENT_ERROR(
33989 RESPONSE_EVENT_ERROR_DATA::random(rng),
33990 )),
33991 SAFETY_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_ALLOWED_AREA(
33992 SAFETY_ALLOWED_AREA_DATA::random(rng),
33993 )),
33994 SAFETY_SET_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_SET_ALLOWED_AREA(
33995 SAFETY_SET_ALLOWED_AREA_DATA::random(rng),
33996 )),
33997 SCALED_IMU_DATA::ID => Some(Self::SCALED_IMU(SCALED_IMU_DATA::random(rng))),
33998 SCALED_IMU2_DATA::ID => Some(Self::SCALED_IMU2(SCALED_IMU2_DATA::random(rng))),
33999 SCALED_IMU3_DATA::ID => Some(Self::SCALED_IMU3(SCALED_IMU3_DATA::random(rng))),
34000 SCALED_PRESSURE_DATA::ID => {
34001 Some(Self::SCALED_PRESSURE(SCALED_PRESSURE_DATA::random(rng)))
34002 }
34003 SCALED_PRESSURE2_DATA::ID => {
34004 Some(Self::SCALED_PRESSURE2(SCALED_PRESSURE2_DATA::random(rng)))
34005 }
34006 SCALED_PRESSURE3_DATA::ID => {
34007 Some(Self::SCALED_PRESSURE3(SCALED_PRESSURE3_DATA::random(rng)))
34008 }
34009 SCRIPT_COUNT_DATA::ID => Some(Self::SCRIPT_COUNT(SCRIPT_COUNT_DATA::random(rng))),
34010 SCRIPT_CURRENT_DATA::ID => Some(Self::SCRIPT_CURRENT(SCRIPT_CURRENT_DATA::random(rng))),
34011 SCRIPT_ITEM_DATA::ID => Some(Self::SCRIPT_ITEM(SCRIPT_ITEM_DATA::random(rng))),
34012 SCRIPT_REQUEST_DATA::ID => Some(Self::SCRIPT_REQUEST(SCRIPT_REQUEST_DATA::random(rng))),
34013 SCRIPT_REQUEST_LIST_DATA::ID => Some(Self::SCRIPT_REQUEST_LIST(
34014 SCRIPT_REQUEST_LIST_DATA::random(rng),
34015 )),
34016 SERIAL_CONTROL_DATA::ID => Some(Self::SERIAL_CONTROL(SERIAL_CONTROL_DATA::random(rng))),
34017 SERVO_OUTPUT_RAW_DATA::ID => {
34018 Some(Self::SERVO_OUTPUT_RAW(SERVO_OUTPUT_RAW_DATA::random(rng)))
34019 }
34020 SETUP_SIGNING_DATA::ID => Some(Self::SETUP_SIGNING(SETUP_SIGNING_DATA::random(rng))),
34021 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::SET_ACTUATOR_CONTROL_TARGET(
34022 SET_ACTUATOR_CONTROL_TARGET_DATA::random(rng),
34023 )),
34024 SET_ATTITUDE_TARGET_DATA::ID => Some(Self::SET_ATTITUDE_TARGET(
34025 SET_ATTITUDE_TARGET_DATA::random(rng),
34026 )),
34027 SET_GPS_GLOBAL_ORIGIN_DATA::ID => Some(Self::SET_GPS_GLOBAL_ORIGIN(
34028 SET_GPS_GLOBAL_ORIGIN_DATA::random(rng),
34029 )),
34030 SET_HOME_POSITION_DATA::ID => {
34031 Some(Self::SET_HOME_POSITION(SET_HOME_POSITION_DATA::random(rng)))
34032 }
34033 SET_MODE_DATA::ID => Some(Self::SET_MODE(SET_MODE_DATA::random(rng))),
34034 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::SET_POSITION_TARGET_GLOBAL_INT(
34035 SET_POSITION_TARGET_GLOBAL_INT_DATA::random(rng),
34036 )),
34037 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::SET_POSITION_TARGET_LOCAL_NED(
34038 SET_POSITION_TARGET_LOCAL_NED_DATA::random(rng),
34039 )),
34040 SIM_STATE_DATA::ID => Some(Self::SIM_STATE(SIM_STATE_DATA::random(rng))),
34041 SMART_BATTERY_INFO_DATA::ID => Some(Self::SMART_BATTERY_INFO(
34042 SMART_BATTERY_INFO_DATA::random(rng),
34043 )),
34044 STATUSTEXT_DATA::ID => Some(Self::STATUSTEXT(STATUSTEXT_DATA::random(rng))),
34045 STORAGE_INFORMATION_DATA::ID => Some(Self::STORAGE_INFORMATION(
34046 STORAGE_INFORMATION_DATA::random(rng),
34047 )),
34048 SUPPORTED_TUNES_DATA::ID => {
34049 Some(Self::SUPPORTED_TUNES(SUPPORTED_TUNES_DATA::random(rng)))
34050 }
34051 SYSTEM_TIME_DATA::ID => Some(Self::SYSTEM_TIME(SYSTEM_TIME_DATA::random(rng))),
34052 SYS_STATUS_DATA::ID => Some(Self::SYS_STATUS(SYS_STATUS_DATA::random(rng))),
34053 TERRAIN_CHECK_DATA::ID => Some(Self::TERRAIN_CHECK(TERRAIN_CHECK_DATA::random(rng))),
34054 TERRAIN_DATA_DATA::ID => Some(Self::TERRAIN_DATA(TERRAIN_DATA_DATA::random(rng))),
34055 TERRAIN_REPORT_DATA::ID => Some(Self::TERRAIN_REPORT(TERRAIN_REPORT_DATA::random(rng))),
34056 TERRAIN_REQUEST_DATA::ID => {
34057 Some(Self::TERRAIN_REQUEST(TERRAIN_REQUEST_DATA::random(rng)))
34058 }
34059 TIMESYNC_DATA::ID => Some(Self::TIMESYNC(TIMESYNC_DATA::random(rng))),
34060 TIME_ESTIMATE_TO_TARGET_DATA::ID => Some(Self::TIME_ESTIMATE_TO_TARGET(
34061 TIME_ESTIMATE_TO_TARGET_DATA::random(rng),
34062 )),
34063 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
34064 Some(Self::TRAJECTORY_REPRESENTATION_BEZIER(
34065 TRAJECTORY_REPRESENTATION_BEZIER_DATA::random(rng),
34066 ))
34067 }
34068 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
34069 Some(Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(
34070 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::random(rng),
34071 ))
34072 }
34073 TUNNEL_DATA::ID => Some(Self::TUNNEL(TUNNEL_DATA::random(rng))),
34074 UAVCAN_NODE_INFO_DATA::ID => {
34075 Some(Self::UAVCAN_NODE_INFO(UAVCAN_NODE_INFO_DATA::random(rng)))
34076 }
34077 UAVCAN_NODE_STATUS_DATA::ID => Some(Self::UAVCAN_NODE_STATUS(
34078 UAVCAN_NODE_STATUS_DATA::random(rng),
34079 )),
34080 UTM_GLOBAL_POSITION_DATA::ID => Some(Self::UTM_GLOBAL_POSITION(
34081 UTM_GLOBAL_POSITION_DATA::random(rng),
34082 )),
34083 V2_EXTENSION_DATA::ID => Some(Self::V2_EXTENSION(V2_EXTENSION_DATA::random(rng))),
34084 VFR_HUD_DATA::ID => Some(Self::VFR_HUD(VFR_HUD_DATA::random(rng))),
34085 VIBRATION_DATA::ID => Some(Self::VIBRATION(VIBRATION_DATA::random(rng))),
34086 VICON_POSITION_ESTIMATE_DATA::ID => Some(Self::VICON_POSITION_ESTIMATE(
34087 VICON_POSITION_ESTIMATE_DATA::random(rng),
34088 )),
34089 VIDEO_STREAM_INFORMATION_DATA::ID => Some(Self::VIDEO_STREAM_INFORMATION(
34090 VIDEO_STREAM_INFORMATION_DATA::random(rng),
34091 )),
34092 VIDEO_STREAM_STATUS_DATA::ID => Some(Self::VIDEO_STREAM_STATUS(
34093 VIDEO_STREAM_STATUS_DATA::random(rng),
34094 )),
34095 VISION_POSITION_ESTIMATE_DATA::ID => Some(Self::VISION_POSITION_ESTIMATE(
34096 VISION_POSITION_ESTIMATE_DATA::random(rng),
34097 )),
34098 VISION_SPEED_ESTIMATE_DATA::ID => Some(Self::VISION_SPEED_ESTIMATE(
34099 VISION_SPEED_ESTIMATE_DATA::random(rng),
34100 )),
34101 WHEEL_DISTANCE_DATA::ID => Some(Self::WHEEL_DISTANCE(WHEEL_DISTANCE_DATA::random(rng))),
34102 WIFI_CONFIG_AP_DATA::ID => Some(Self::WIFI_CONFIG_AP(WIFI_CONFIG_AP_DATA::random(rng))),
34103 WINCH_STATUS_DATA::ID => Some(Self::WINCH_STATUS(WINCH_STATUS_DATA::random(rng))),
34104 WIND_COV_DATA::ID => Some(Self::WIND_COV(WIND_COV_DATA::random(rng))),
34105 _ => None,
34106 }
34107 }
34108 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
34109 match self {
34110 Self::ACTUATOR_CONTROL_TARGET(body) => body.ser(version, bytes),
34111 Self::ACTUATOR_OUTPUT_STATUS(body) => body.ser(version, bytes),
34112 Self::ADSB_VEHICLE(body) => body.ser(version, bytes),
34113 Self::AIS_VESSEL(body) => body.ser(version, bytes),
34114 Self::ALTITUDE(body) => body.ser(version, bytes),
34115 Self::ATTITUDE(body) => body.ser(version, bytes),
34116 Self::ATTITUDE_QUATERNION(body) => body.ser(version, bytes),
34117 Self::ATTITUDE_QUATERNION_COV(body) => body.ser(version, bytes),
34118 Self::ATTITUDE_TARGET(body) => body.ser(version, bytes),
34119 Self::ATT_POS_MOCAP(body) => body.ser(version, bytes),
34120 Self::AUTH_KEY(body) => body.ser(version, bytes),
34121 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(body) => body.ser(version, bytes),
34122 Self::AUTOPILOT_VERSION(body) => body.ser(version, bytes),
34123 Self::AVAILABLE_MODES(body) => body.ser(version, bytes),
34124 Self::AVAILABLE_MODES_MONITOR(body) => body.ser(version, bytes),
34125 Self::BATTERY_INFO(body) => body.ser(version, bytes),
34126 Self::BATTERY_STATUS(body) => body.ser(version, bytes),
34127 Self::BUTTON_CHANGE(body) => body.ser(version, bytes),
34128 Self::CAMERA_CAPTURE_STATUS(body) => body.ser(version, bytes),
34129 Self::CAMERA_FOV_STATUS(body) => body.ser(version, bytes),
34130 Self::CAMERA_IMAGE_CAPTURED(body) => body.ser(version, bytes),
34131 Self::CAMERA_INFORMATION(body) => body.ser(version, bytes),
34132 Self::CAMERA_SETTINGS(body) => body.ser(version, bytes),
34133 Self::CAMERA_THERMAL_RANGE(body) => body.ser(version, bytes),
34134 Self::CAMERA_TRACKING_GEO_STATUS(body) => body.ser(version, bytes),
34135 Self::CAMERA_TRACKING_IMAGE_STATUS(body) => body.ser(version, bytes),
34136 Self::CAMERA_TRIGGER(body) => body.ser(version, bytes),
34137 Self::CANFD_FRAME(body) => body.ser(version, bytes),
34138 Self::CAN_FILTER_MODIFY(body) => body.ser(version, bytes),
34139 Self::CAN_FRAME(body) => body.ser(version, bytes),
34140 Self::CELLULAR_CONFIG(body) => body.ser(version, bytes),
34141 Self::CELLULAR_STATUS(body) => body.ser(version, bytes),
34142 Self::CHANGE_OPERATOR_CONTROL(body) => body.ser(version, bytes),
34143 Self::CHANGE_OPERATOR_CONTROL_ACK(body) => body.ser(version, bytes),
34144 Self::COLLISION(body) => body.ser(version, bytes),
34145 Self::COMMAND_ACK(body) => body.ser(version, bytes),
34146 Self::COMMAND_CANCEL(body) => body.ser(version, bytes),
34147 Self::COMMAND_INT(body) => body.ser(version, bytes),
34148 Self::COMMAND_LONG(body) => body.ser(version, bytes),
34149 Self::COMPONENT_INFORMATION(body) => body.ser(version, bytes),
34150 Self::COMPONENT_INFORMATION_BASIC(body) => body.ser(version, bytes),
34151 Self::COMPONENT_METADATA(body) => body.ser(version, bytes),
34152 Self::CONTROL_SYSTEM_STATE(body) => body.ser(version, bytes),
34153 Self::CURRENT_EVENT_SEQUENCE(body) => body.ser(version, bytes),
34154 Self::CURRENT_MODE(body) => body.ser(version, bytes),
34155 Self::DATA_STREAM(body) => body.ser(version, bytes),
34156 Self::DATA_TRANSMISSION_HANDSHAKE(body) => body.ser(version, bytes),
34157 Self::DEBUG(body) => body.ser(version, bytes),
34158 Self::DEBUG_FLOAT_ARRAY(body) => body.ser(version, bytes),
34159 Self::DEBUG_VECT(body) => body.ser(version, bytes),
34160 Self::DISTANCE_SENSOR(body) => body.ser(version, bytes),
34161 Self::EFI_STATUS(body) => body.ser(version, bytes),
34162 Self::ENCAPSULATED_DATA(body) => body.ser(version, bytes),
34163 Self::ESC_INFO(body) => body.ser(version, bytes),
34164 Self::ESC_STATUS(body) => body.ser(version, bytes),
34165 Self::ESTIMATOR_STATUS(body) => body.ser(version, bytes),
34166 Self::EVENT(body) => body.ser(version, bytes),
34167 Self::EXTENDED_SYS_STATE(body) => body.ser(version, bytes),
34168 Self::FENCE_STATUS(body) => body.ser(version, bytes),
34169 Self::FILE_TRANSFER_PROTOCOL(body) => body.ser(version, bytes),
34170 Self::FLIGHT_INFORMATION(body) => body.ser(version, bytes),
34171 Self::FOLLOW_TARGET(body) => body.ser(version, bytes),
34172 Self::FUEL_STATUS(body) => body.ser(version, bytes),
34173 Self::GENERATOR_STATUS(body) => body.ser(version, bytes),
34174 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(body) => body.ser(version, bytes),
34175 Self::GIMBAL_DEVICE_INFORMATION(body) => body.ser(version, bytes),
34176 Self::GIMBAL_DEVICE_SET_ATTITUDE(body) => body.ser(version, bytes),
34177 Self::GIMBAL_MANAGER_INFORMATION(body) => body.ser(version, bytes),
34178 Self::GIMBAL_MANAGER_SET_ATTITUDE(body) => body.ser(version, bytes),
34179 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(body) => body.ser(version, bytes),
34180 Self::GIMBAL_MANAGER_SET_PITCHYAW(body) => body.ser(version, bytes),
34181 Self::GIMBAL_MANAGER_STATUS(body) => body.ser(version, bytes),
34182 Self::GLOBAL_POSITION_INT(body) => body.ser(version, bytes),
34183 Self::GLOBAL_POSITION_INT_COV(body) => body.ser(version, bytes),
34184 Self::GLOBAL_VISION_POSITION_ESTIMATE(body) => body.ser(version, bytes),
34185 Self::GPS2_RAW(body) => body.ser(version, bytes),
34186 Self::GPS2_RTK(body) => body.ser(version, bytes),
34187 Self::GPS_GLOBAL_ORIGIN(body) => body.ser(version, bytes),
34188 Self::GPS_INJECT_DATA(body) => body.ser(version, bytes),
34189 Self::GPS_INPUT(body) => body.ser(version, bytes),
34190 Self::GPS_RAW_INT(body) => body.ser(version, bytes),
34191 Self::GPS_RTCM_DATA(body) => body.ser(version, bytes),
34192 Self::GPS_RTK(body) => body.ser(version, bytes),
34193 Self::GPS_STATUS(body) => body.ser(version, bytes),
34194 Self::HEARTBEAT(body) => body.ser(version, bytes),
34195 Self::HIGHRES_IMU(body) => body.ser(version, bytes),
34196 Self::HIGH_LATENCY(body) => body.ser(version, bytes),
34197 Self::HIGH_LATENCY2(body) => body.ser(version, bytes),
34198 Self::HIL_ACTUATOR_CONTROLS(body) => body.ser(version, bytes),
34199 Self::HIL_CONTROLS(body) => body.ser(version, bytes),
34200 Self::HIL_GPS(body) => body.ser(version, bytes),
34201 Self::HIL_OPTICAL_FLOW(body) => body.ser(version, bytes),
34202 Self::HIL_RC_INPUTS_RAW(body) => body.ser(version, bytes),
34203 Self::HIL_SENSOR(body) => body.ser(version, bytes),
34204 Self::HIL_STATE(body) => body.ser(version, bytes),
34205 Self::HIL_STATE_QUATERNION(body) => body.ser(version, bytes),
34206 Self::HOME_POSITION(body) => body.ser(version, bytes),
34207 Self::HYGROMETER_SENSOR(body) => body.ser(version, bytes),
34208 Self::ILLUMINATOR_STATUS(body) => body.ser(version, bytes),
34209 Self::ISBD_LINK_STATUS(body) => body.ser(version, bytes),
34210 Self::LANDING_TARGET(body) => body.ser(version, bytes),
34211 Self::LINK_NODE_STATUS(body) => body.ser(version, bytes),
34212 Self::LOCAL_POSITION_NED(body) => body.ser(version, bytes),
34213 Self::LOCAL_POSITION_NED_COV(body) => body.ser(version, bytes),
34214 Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(body) => body.ser(version, bytes),
34215 Self::LOGGING_ACK(body) => body.ser(version, bytes),
34216 Self::LOGGING_DATA(body) => body.ser(version, bytes),
34217 Self::LOGGING_DATA_ACKED(body) => body.ser(version, bytes),
34218 Self::LOG_DATA(body) => body.ser(version, bytes),
34219 Self::LOG_ENTRY(body) => body.ser(version, bytes),
34220 Self::LOG_ERASE(body) => body.ser(version, bytes),
34221 Self::LOG_REQUEST_DATA(body) => body.ser(version, bytes),
34222 Self::LOG_REQUEST_END(body) => body.ser(version, bytes),
34223 Self::LOG_REQUEST_LIST(body) => body.ser(version, bytes),
34224 Self::MAG_CAL_REPORT(body) => body.ser(version, bytes),
34225 Self::MANUAL_CONTROL(body) => body.ser(version, bytes),
34226 Self::MANUAL_SETPOINT(body) => body.ser(version, bytes),
34227 Self::MEMORY_VECT(body) => body.ser(version, bytes),
34228 Self::MESSAGE_INTERVAL(body) => body.ser(version, bytes),
34229 Self::MISSION_ACK(body) => body.ser(version, bytes),
34230 Self::MISSION_CLEAR_ALL(body) => body.ser(version, bytes),
34231 Self::MISSION_COUNT(body) => body.ser(version, bytes),
34232 Self::MISSION_CURRENT(body) => body.ser(version, bytes),
34233 Self::MISSION_ITEM(body) => body.ser(version, bytes),
34234 Self::MISSION_ITEM_INT(body) => body.ser(version, bytes),
34235 Self::MISSION_ITEM_REACHED(body) => body.ser(version, bytes),
34236 Self::MISSION_REQUEST(body) => body.ser(version, bytes),
34237 Self::MISSION_REQUEST_INT(body) => body.ser(version, bytes),
34238 Self::MISSION_REQUEST_LIST(body) => body.ser(version, bytes),
34239 Self::MISSION_REQUEST_PARTIAL_LIST(body) => body.ser(version, bytes),
34240 Self::MISSION_SET_CURRENT(body) => body.ser(version, bytes),
34241 Self::MISSION_WRITE_PARTIAL_LIST(body) => body.ser(version, bytes),
34242 Self::MOUNT_ORIENTATION(body) => body.ser(version, bytes),
34243 Self::NAMED_VALUE_FLOAT(body) => body.ser(version, bytes),
34244 Self::NAMED_VALUE_INT(body) => body.ser(version, bytes),
34245 Self::NAV_CONTROLLER_OUTPUT(body) => body.ser(version, bytes),
34246 Self::OBSTACLE_DISTANCE(body) => body.ser(version, bytes),
34247 Self::ODOMETRY(body) => body.ser(version, bytes),
34248 Self::ONBOARD_COMPUTER_STATUS(body) => body.ser(version, bytes),
34249 Self::OPEN_DRONE_ID_ARM_STATUS(body) => body.ser(version, bytes),
34250 Self::OPEN_DRONE_ID_AUTHENTICATION(body) => body.ser(version, bytes),
34251 Self::OPEN_DRONE_ID_BASIC_ID(body) => body.ser(version, bytes),
34252 Self::OPEN_DRONE_ID_LOCATION(body) => body.ser(version, bytes),
34253 Self::OPEN_DRONE_ID_MESSAGE_PACK(body) => body.ser(version, bytes),
34254 Self::OPEN_DRONE_ID_OPERATOR_ID(body) => body.ser(version, bytes),
34255 Self::OPEN_DRONE_ID_SELF_ID(body) => body.ser(version, bytes),
34256 Self::OPEN_DRONE_ID_SYSTEM(body) => body.ser(version, bytes),
34257 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(body) => body.ser(version, bytes),
34258 Self::OPTICAL_FLOW(body) => body.ser(version, bytes),
34259 Self::OPTICAL_FLOW_RAD(body) => body.ser(version, bytes),
34260 Self::ORBIT_EXECUTION_STATUS(body) => body.ser(version, bytes),
34261 Self::PARAM_EXT_ACK(body) => body.ser(version, bytes),
34262 Self::PARAM_EXT_REQUEST_LIST(body) => body.ser(version, bytes),
34263 Self::PARAM_EXT_REQUEST_READ(body) => body.ser(version, bytes),
34264 Self::PARAM_EXT_SET(body) => body.ser(version, bytes),
34265 Self::PARAM_EXT_VALUE(body) => body.ser(version, bytes),
34266 Self::PARAM_MAP_RC(body) => body.ser(version, bytes),
34267 Self::PARAM_REQUEST_LIST(body) => body.ser(version, bytes),
34268 Self::PARAM_REQUEST_READ(body) => body.ser(version, bytes),
34269 Self::PARAM_SET(body) => body.ser(version, bytes),
34270 Self::PARAM_VALUE(body) => body.ser(version, bytes),
34271 Self::PING(body) => body.ser(version, bytes),
34272 Self::PLAY_TUNE(body) => body.ser(version, bytes),
34273 Self::PLAY_TUNE_V2(body) => body.ser(version, bytes),
34274 Self::POSITION_TARGET_GLOBAL_INT(body) => body.ser(version, bytes),
34275 Self::POSITION_TARGET_LOCAL_NED(body) => body.ser(version, bytes),
34276 Self::POWER_STATUS(body) => body.ser(version, bytes),
34277 Self::PROTOCOL_VERSION(body) => body.ser(version, bytes),
34278 Self::RADIO_STATUS(body) => body.ser(version, bytes),
34279 Self::RAW_IMU(body) => body.ser(version, bytes),
34280 Self::RAW_PRESSURE(body) => body.ser(version, bytes),
34281 Self::RAW_RPM(body) => body.ser(version, bytes),
34282 Self::RC_CHANNELS(body) => body.ser(version, bytes),
34283 Self::RC_CHANNELS_OVERRIDE(body) => body.ser(version, bytes),
34284 Self::RC_CHANNELS_RAW(body) => body.ser(version, bytes),
34285 Self::RC_CHANNELS_SCALED(body) => body.ser(version, bytes),
34286 Self::REQUEST_DATA_STREAM(body) => body.ser(version, bytes),
34287 Self::REQUEST_EVENT(body) => body.ser(version, bytes),
34288 Self::RESOURCE_REQUEST(body) => body.ser(version, bytes),
34289 Self::RESPONSE_EVENT_ERROR(body) => body.ser(version, bytes),
34290 Self::SAFETY_ALLOWED_AREA(body) => body.ser(version, bytes),
34291 Self::SAFETY_SET_ALLOWED_AREA(body) => body.ser(version, bytes),
34292 Self::SCALED_IMU(body) => body.ser(version, bytes),
34293 Self::SCALED_IMU2(body) => body.ser(version, bytes),
34294 Self::SCALED_IMU3(body) => body.ser(version, bytes),
34295 Self::SCALED_PRESSURE(body) => body.ser(version, bytes),
34296 Self::SCALED_PRESSURE2(body) => body.ser(version, bytes),
34297 Self::SCALED_PRESSURE3(body) => body.ser(version, bytes),
34298 Self::SCRIPT_COUNT(body) => body.ser(version, bytes),
34299 Self::SCRIPT_CURRENT(body) => body.ser(version, bytes),
34300 Self::SCRIPT_ITEM(body) => body.ser(version, bytes),
34301 Self::SCRIPT_REQUEST(body) => body.ser(version, bytes),
34302 Self::SCRIPT_REQUEST_LIST(body) => body.ser(version, bytes),
34303 Self::SERIAL_CONTROL(body) => body.ser(version, bytes),
34304 Self::SERVO_OUTPUT_RAW(body) => body.ser(version, bytes),
34305 Self::SETUP_SIGNING(body) => body.ser(version, bytes),
34306 Self::SET_ACTUATOR_CONTROL_TARGET(body) => body.ser(version, bytes),
34307 Self::SET_ATTITUDE_TARGET(body) => body.ser(version, bytes),
34308 Self::SET_GPS_GLOBAL_ORIGIN(body) => body.ser(version, bytes),
34309 Self::SET_HOME_POSITION(body) => body.ser(version, bytes),
34310 Self::SET_MODE(body) => body.ser(version, bytes),
34311 Self::SET_POSITION_TARGET_GLOBAL_INT(body) => body.ser(version, bytes),
34312 Self::SET_POSITION_TARGET_LOCAL_NED(body) => body.ser(version, bytes),
34313 Self::SIM_STATE(body) => body.ser(version, bytes),
34314 Self::SMART_BATTERY_INFO(body) => body.ser(version, bytes),
34315 Self::STATUSTEXT(body) => body.ser(version, bytes),
34316 Self::STORAGE_INFORMATION(body) => body.ser(version, bytes),
34317 Self::SUPPORTED_TUNES(body) => body.ser(version, bytes),
34318 Self::SYSTEM_TIME(body) => body.ser(version, bytes),
34319 Self::SYS_STATUS(body) => body.ser(version, bytes),
34320 Self::TERRAIN_CHECK(body) => body.ser(version, bytes),
34321 Self::TERRAIN_DATA(body) => body.ser(version, bytes),
34322 Self::TERRAIN_REPORT(body) => body.ser(version, bytes),
34323 Self::TERRAIN_REQUEST(body) => body.ser(version, bytes),
34324 Self::TIMESYNC(body) => body.ser(version, bytes),
34325 Self::TIME_ESTIMATE_TO_TARGET(body) => body.ser(version, bytes),
34326 Self::TRAJECTORY_REPRESENTATION_BEZIER(body) => body.ser(version, bytes),
34327 Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(body) => body.ser(version, bytes),
34328 Self::TUNNEL(body) => body.ser(version, bytes),
34329 Self::UAVCAN_NODE_INFO(body) => body.ser(version, bytes),
34330 Self::UAVCAN_NODE_STATUS(body) => body.ser(version, bytes),
34331 Self::UTM_GLOBAL_POSITION(body) => body.ser(version, bytes),
34332 Self::V2_EXTENSION(body) => body.ser(version, bytes),
34333 Self::VFR_HUD(body) => body.ser(version, bytes),
34334 Self::VIBRATION(body) => body.ser(version, bytes),
34335 Self::VICON_POSITION_ESTIMATE(body) => body.ser(version, bytes),
34336 Self::VIDEO_STREAM_INFORMATION(body) => body.ser(version, bytes),
34337 Self::VIDEO_STREAM_STATUS(body) => body.ser(version, bytes),
34338 Self::VISION_POSITION_ESTIMATE(body) => body.ser(version, bytes),
34339 Self::VISION_SPEED_ESTIMATE(body) => body.ser(version, bytes),
34340 Self::WHEEL_DISTANCE(body) => body.ser(version, bytes),
34341 Self::WIFI_CONFIG_AP(body) => body.ser(version, bytes),
34342 Self::WINCH_STATUS(body) => body.ser(version, bytes),
34343 Self::WIND_COV(body) => body.ser(version, bytes),
34344 }
34345 }
34346 fn extra_crc(id: u32) -> u8 {
34347 match id {
34348 ACTUATOR_CONTROL_TARGET_DATA::ID => ACTUATOR_CONTROL_TARGET_DATA::EXTRA_CRC,
34349 ACTUATOR_OUTPUT_STATUS_DATA::ID => ACTUATOR_OUTPUT_STATUS_DATA::EXTRA_CRC,
34350 ADSB_VEHICLE_DATA::ID => ADSB_VEHICLE_DATA::EXTRA_CRC,
34351 AIS_VESSEL_DATA::ID => AIS_VESSEL_DATA::EXTRA_CRC,
34352 ALTITUDE_DATA::ID => ALTITUDE_DATA::EXTRA_CRC,
34353 ATTITUDE_DATA::ID => ATTITUDE_DATA::EXTRA_CRC,
34354 ATTITUDE_QUATERNION_DATA::ID => ATTITUDE_QUATERNION_DATA::EXTRA_CRC,
34355 ATTITUDE_QUATERNION_COV_DATA::ID => ATTITUDE_QUATERNION_COV_DATA::EXTRA_CRC,
34356 ATTITUDE_TARGET_DATA::ID => ATTITUDE_TARGET_DATA::EXTRA_CRC,
34357 ATT_POS_MOCAP_DATA::ID => ATT_POS_MOCAP_DATA::EXTRA_CRC,
34358 AUTH_KEY_DATA::ID => AUTH_KEY_DATA::EXTRA_CRC,
34359 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
34360 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::EXTRA_CRC
34361 }
34362 AUTOPILOT_VERSION_DATA::ID => AUTOPILOT_VERSION_DATA::EXTRA_CRC,
34363 AVAILABLE_MODES_DATA::ID => AVAILABLE_MODES_DATA::EXTRA_CRC,
34364 AVAILABLE_MODES_MONITOR_DATA::ID => AVAILABLE_MODES_MONITOR_DATA::EXTRA_CRC,
34365 BATTERY_INFO_DATA::ID => BATTERY_INFO_DATA::EXTRA_CRC,
34366 BATTERY_STATUS_DATA::ID => BATTERY_STATUS_DATA::EXTRA_CRC,
34367 BUTTON_CHANGE_DATA::ID => BUTTON_CHANGE_DATA::EXTRA_CRC,
34368 CAMERA_CAPTURE_STATUS_DATA::ID => CAMERA_CAPTURE_STATUS_DATA::EXTRA_CRC,
34369 CAMERA_FOV_STATUS_DATA::ID => CAMERA_FOV_STATUS_DATA::EXTRA_CRC,
34370 CAMERA_IMAGE_CAPTURED_DATA::ID => CAMERA_IMAGE_CAPTURED_DATA::EXTRA_CRC,
34371 CAMERA_INFORMATION_DATA::ID => CAMERA_INFORMATION_DATA::EXTRA_CRC,
34372 CAMERA_SETTINGS_DATA::ID => CAMERA_SETTINGS_DATA::EXTRA_CRC,
34373 CAMERA_THERMAL_RANGE_DATA::ID => CAMERA_THERMAL_RANGE_DATA::EXTRA_CRC,
34374 CAMERA_TRACKING_GEO_STATUS_DATA::ID => CAMERA_TRACKING_GEO_STATUS_DATA::EXTRA_CRC,
34375 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => CAMERA_TRACKING_IMAGE_STATUS_DATA::EXTRA_CRC,
34376 CAMERA_TRIGGER_DATA::ID => CAMERA_TRIGGER_DATA::EXTRA_CRC,
34377 CANFD_FRAME_DATA::ID => CANFD_FRAME_DATA::EXTRA_CRC,
34378 CAN_FILTER_MODIFY_DATA::ID => CAN_FILTER_MODIFY_DATA::EXTRA_CRC,
34379 CAN_FRAME_DATA::ID => CAN_FRAME_DATA::EXTRA_CRC,
34380 CELLULAR_CONFIG_DATA::ID => CELLULAR_CONFIG_DATA::EXTRA_CRC,
34381 CELLULAR_STATUS_DATA::ID => CELLULAR_STATUS_DATA::EXTRA_CRC,
34382 CHANGE_OPERATOR_CONTROL_DATA::ID => CHANGE_OPERATOR_CONTROL_DATA::EXTRA_CRC,
34383 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => CHANGE_OPERATOR_CONTROL_ACK_DATA::EXTRA_CRC,
34384 COLLISION_DATA::ID => COLLISION_DATA::EXTRA_CRC,
34385 COMMAND_ACK_DATA::ID => COMMAND_ACK_DATA::EXTRA_CRC,
34386 COMMAND_CANCEL_DATA::ID => COMMAND_CANCEL_DATA::EXTRA_CRC,
34387 COMMAND_INT_DATA::ID => COMMAND_INT_DATA::EXTRA_CRC,
34388 COMMAND_LONG_DATA::ID => COMMAND_LONG_DATA::EXTRA_CRC,
34389 COMPONENT_INFORMATION_DATA::ID => COMPONENT_INFORMATION_DATA::EXTRA_CRC,
34390 COMPONENT_INFORMATION_BASIC_DATA::ID => COMPONENT_INFORMATION_BASIC_DATA::EXTRA_CRC,
34391 COMPONENT_METADATA_DATA::ID => COMPONENT_METADATA_DATA::EXTRA_CRC,
34392 CONTROL_SYSTEM_STATE_DATA::ID => CONTROL_SYSTEM_STATE_DATA::EXTRA_CRC,
34393 CURRENT_EVENT_SEQUENCE_DATA::ID => CURRENT_EVENT_SEQUENCE_DATA::EXTRA_CRC,
34394 CURRENT_MODE_DATA::ID => CURRENT_MODE_DATA::EXTRA_CRC,
34395 DATA_STREAM_DATA::ID => DATA_STREAM_DATA::EXTRA_CRC,
34396 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => DATA_TRANSMISSION_HANDSHAKE_DATA::EXTRA_CRC,
34397 DEBUG_DATA::ID => DEBUG_DATA::EXTRA_CRC,
34398 DEBUG_FLOAT_ARRAY_DATA::ID => DEBUG_FLOAT_ARRAY_DATA::EXTRA_CRC,
34399 DEBUG_VECT_DATA::ID => DEBUG_VECT_DATA::EXTRA_CRC,
34400 DISTANCE_SENSOR_DATA::ID => DISTANCE_SENSOR_DATA::EXTRA_CRC,
34401 EFI_STATUS_DATA::ID => EFI_STATUS_DATA::EXTRA_CRC,
34402 ENCAPSULATED_DATA_DATA::ID => ENCAPSULATED_DATA_DATA::EXTRA_CRC,
34403 ESC_INFO_DATA::ID => ESC_INFO_DATA::EXTRA_CRC,
34404 ESC_STATUS_DATA::ID => ESC_STATUS_DATA::EXTRA_CRC,
34405 ESTIMATOR_STATUS_DATA::ID => ESTIMATOR_STATUS_DATA::EXTRA_CRC,
34406 EVENT_DATA::ID => EVENT_DATA::EXTRA_CRC,
34407 EXTENDED_SYS_STATE_DATA::ID => EXTENDED_SYS_STATE_DATA::EXTRA_CRC,
34408 FENCE_STATUS_DATA::ID => FENCE_STATUS_DATA::EXTRA_CRC,
34409 FILE_TRANSFER_PROTOCOL_DATA::ID => FILE_TRANSFER_PROTOCOL_DATA::EXTRA_CRC,
34410 FLIGHT_INFORMATION_DATA::ID => FLIGHT_INFORMATION_DATA::EXTRA_CRC,
34411 FOLLOW_TARGET_DATA::ID => FOLLOW_TARGET_DATA::EXTRA_CRC,
34412 FUEL_STATUS_DATA::ID => FUEL_STATUS_DATA::EXTRA_CRC,
34413 GENERATOR_STATUS_DATA::ID => GENERATOR_STATUS_DATA::EXTRA_CRC,
34414 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::EXTRA_CRC,
34415 GIMBAL_DEVICE_INFORMATION_DATA::ID => GIMBAL_DEVICE_INFORMATION_DATA::EXTRA_CRC,
34416 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => GIMBAL_DEVICE_SET_ATTITUDE_DATA::EXTRA_CRC,
34417 GIMBAL_MANAGER_INFORMATION_DATA::ID => GIMBAL_MANAGER_INFORMATION_DATA::EXTRA_CRC,
34418 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => GIMBAL_MANAGER_SET_ATTITUDE_DATA::EXTRA_CRC,
34419 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
34420 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::EXTRA_CRC
34421 }
34422 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => GIMBAL_MANAGER_SET_PITCHYAW_DATA::EXTRA_CRC,
34423 GIMBAL_MANAGER_STATUS_DATA::ID => GIMBAL_MANAGER_STATUS_DATA::EXTRA_CRC,
34424 GLOBAL_POSITION_INT_DATA::ID => GLOBAL_POSITION_INT_DATA::EXTRA_CRC,
34425 GLOBAL_POSITION_INT_COV_DATA::ID => GLOBAL_POSITION_INT_COV_DATA::EXTRA_CRC,
34426 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
34427 GLOBAL_VISION_POSITION_ESTIMATE_DATA::EXTRA_CRC
34428 }
34429 GPS2_RAW_DATA::ID => GPS2_RAW_DATA::EXTRA_CRC,
34430 GPS2_RTK_DATA::ID => GPS2_RTK_DATA::EXTRA_CRC,
34431 GPS_GLOBAL_ORIGIN_DATA::ID => GPS_GLOBAL_ORIGIN_DATA::EXTRA_CRC,
34432 GPS_INJECT_DATA_DATA::ID => GPS_INJECT_DATA_DATA::EXTRA_CRC,
34433 GPS_INPUT_DATA::ID => GPS_INPUT_DATA::EXTRA_CRC,
34434 GPS_RAW_INT_DATA::ID => GPS_RAW_INT_DATA::EXTRA_CRC,
34435 GPS_RTCM_DATA_DATA::ID => GPS_RTCM_DATA_DATA::EXTRA_CRC,
34436 GPS_RTK_DATA::ID => GPS_RTK_DATA::EXTRA_CRC,
34437 GPS_STATUS_DATA::ID => GPS_STATUS_DATA::EXTRA_CRC,
34438 HEARTBEAT_DATA::ID => HEARTBEAT_DATA::EXTRA_CRC,
34439 HIGHRES_IMU_DATA::ID => HIGHRES_IMU_DATA::EXTRA_CRC,
34440 HIGH_LATENCY_DATA::ID => HIGH_LATENCY_DATA::EXTRA_CRC,
34441 HIGH_LATENCY2_DATA::ID => HIGH_LATENCY2_DATA::EXTRA_CRC,
34442 HIL_ACTUATOR_CONTROLS_DATA::ID => HIL_ACTUATOR_CONTROLS_DATA::EXTRA_CRC,
34443 HIL_CONTROLS_DATA::ID => HIL_CONTROLS_DATA::EXTRA_CRC,
34444 HIL_GPS_DATA::ID => HIL_GPS_DATA::EXTRA_CRC,
34445 HIL_OPTICAL_FLOW_DATA::ID => HIL_OPTICAL_FLOW_DATA::EXTRA_CRC,
34446 HIL_RC_INPUTS_RAW_DATA::ID => HIL_RC_INPUTS_RAW_DATA::EXTRA_CRC,
34447 HIL_SENSOR_DATA::ID => HIL_SENSOR_DATA::EXTRA_CRC,
34448 HIL_STATE_DATA::ID => HIL_STATE_DATA::EXTRA_CRC,
34449 HIL_STATE_QUATERNION_DATA::ID => HIL_STATE_QUATERNION_DATA::EXTRA_CRC,
34450 HOME_POSITION_DATA::ID => HOME_POSITION_DATA::EXTRA_CRC,
34451 HYGROMETER_SENSOR_DATA::ID => HYGROMETER_SENSOR_DATA::EXTRA_CRC,
34452 ILLUMINATOR_STATUS_DATA::ID => ILLUMINATOR_STATUS_DATA::EXTRA_CRC,
34453 ISBD_LINK_STATUS_DATA::ID => ISBD_LINK_STATUS_DATA::EXTRA_CRC,
34454 LANDING_TARGET_DATA::ID => LANDING_TARGET_DATA::EXTRA_CRC,
34455 LINK_NODE_STATUS_DATA::ID => LINK_NODE_STATUS_DATA::EXTRA_CRC,
34456 LOCAL_POSITION_NED_DATA::ID => LOCAL_POSITION_NED_DATA::EXTRA_CRC,
34457 LOCAL_POSITION_NED_COV_DATA::ID => LOCAL_POSITION_NED_COV_DATA::EXTRA_CRC,
34458 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
34459 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::EXTRA_CRC
34460 }
34461 LOGGING_ACK_DATA::ID => LOGGING_ACK_DATA::EXTRA_CRC,
34462 LOGGING_DATA_DATA::ID => LOGGING_DATA_DATA::EXTRA_CRC,
34463 LOGGING_DATA_ACKED_DATA::ID => LOGGING_DATA_ACKED_DATA::EXTRA_CRC,
34464 LOG_DATA_DATA::ID => LOG_DATA_DATA::EXTRA_CRC,
34465 LOG_ENTRY_DATA::ID => LOG_ENTRY_DATA::EXTRA_CRC,
34466 LOG_ERASE_DATA::ID => LOG_ERASE_DATA::EXTRA_CRC,
34467 LOG_REQUEST_DATA_DATA::ID => LOG_REQUEST_DATA_DATA::EXTRA_CRC,
34468 LOG_REQUEST_END_DATA::ID => LOG_REQUEST_END_DATA::EXTRA_CRC,
34469 LOG_REQUEST_LIST_DATA::ID => LOG_REQUEST_LIST_DATA::EXTRA_CRC,
34470 MAG_CAL_REPORT_DATA::ID => MAG_CAL_REPORT_DATA::EXTRA_CRC,
34471 MANUAL_CONTROL_DATA::ID => MANUAL_CONTROL_DATA::EXTRA_CRC,
34472 MANUAL_SETPOINT_DATA::ID => MANUAL_SETPOINT_DATA::EXTRA_CRC,
34473 MEMORY_VECT_DATA::ID => MEMORY_VECT_DATA::EXTRA_CRC,
34474 MESSAGE_INTERVAL_DATA::ID => MESSAGE_INTERVAL_DATA::EXTRA_CRC,
34475 MISSION_ACK_DATA::ID => MISSION_ACK_DATA::EXTRA_CRC,
34476 MISSION_CLEAR_ALL_DATA::ID => MISSION_CLEAR_ALL_DATA::EXTRA_CRC,
34477 MISSION_COUNT_DATA::ID => MISSION_COUNT_DATA::EXTRA_CRC,
34478 MISSION_CURRENT_DATA::ID => MISSION_CURRENT_DATA::EXTRA_CRC,
34479 MISSION_ITEM_DATA::ID => MISSION_ITEM_DATA::EXTRA_CRC,
34480 MISSION_ITEM_INT_DATA::ID => MISSION_ITEM_INT_DATA::EXTRA_CRC,
34481 MISSION_ITEM_REACHED_DATA::ID => MISSION_ITEM_REACHED_DATA::EXTRA_CRC,
34482 MISSION_REQUEST_DATA::ID => MISSION_REQUEST_DATA::EXTRA_CRC,
34483 MISSION_REQUEST_INT_DATA::ID => MISSION_REQUEST_INT_DATA::EXTRA_CRC,
34484 MISSION_REQUEST_LIST_DATA::ID => MISSION_REQUEST_LIST_DATA::EXTRA_CRC,
34485 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => MISSION_REQUEST_PARTIAL_LIST_DATA::EXTRA_CRC,
34486 MISSION_SET_CURRENT_DATA::ID => MISSION_SET_CURRENT_DATA::EXTRA_CRC,
34487 MISSION_WRITE_PARTIAL_LIST_DATA::ID => MISSION_WRITE_PARTIAL_LIST_DATA::EXTRA_CRC,
34488 MOUNT_ORIENTATION_DATA::ID => MOUNT_ORIENTATION_DATA::EXTRA_CRC,
34489 NAMED_VALUE_FLOAT_DATA::ID => NAMED_VALUE_FLOAT_DATA::EXTRA_CRC,
34490 NAMED_VALUE_INT_DATA::ID => NAMED_VALUE_INT_DATA::EXTRA_CRC,
34491 NAV_CONTROLLER_OUTPUT_DATA::ID => NAV_CONTROLLER_OUTPUT_DATA::EXTRA_CRC,
34492 OBSTACLE_DISTANCE_DATA::ID => OBSTACLE_DISTANCE_DATA::EXTRA_CRC,
34493 ODOMETRY_DATA::ID => ODOMETRY_DATA::EXTRA_CRC,
34494 ONBOARD_COMPUTER_STATUS_DATA::ID => ONBOARD_COMPUTER_STATUS_DATA::EXTRA_CRC,
34495 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => OPEN_DRONE_ID_ARM_STATUS_DATA::EXTRA_CRC,
34496 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => OPEN_DRONE_ID_AUTHENTICATION_DATA::EXTRA_CRC,
34497 OPEN_DRONE_ID_BASIC_ID_DATA::ID => OPEN_DRONE_ID_BASIC_ID_DATA::EXTRA_CRC,
34498 OPEN_DRONE_ID_LOCATION_DATA::ID => OPEN_DRONE_ID_LOCATION_DATA::EXTRA_CRC,
34499 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => OPEN_DRONE_ID_MESSAGE_PACK_DATA::EXTRA_CRC,
34500 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => OPEN_DRONE_ID_OPERATOR_ID_DATA::EXTRA_CRC,
34501 OPEN_DRONE_ID_SELF_ID_DATA::ID => OPEN_DRONE_ID_SELF_ID_DATA::EXTRA_CRC,
34502 OPEN_DRONE_ID_SYSTEM_DATA::ID => OPEN_DRONE_ID_SYSTEM_DATA::EXTRA_CRC,
34503 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::EXTRA_CRC,
34504 OPTICAL_FLOW_DATA::ID => OPTICAL_FLOW_DATA::EXTRA_CRC,
34505 OPTICAL_FLOW_RAD_DATA::ID => OPTICAL_FLOW_RAD_DATA::EXTRA_CRC,
34506 ORBIT_EXECUTION_STATUS_DATA::ID => ORBIT_EXECUTION_STATUS_DATA::EXTRA_CRC,
34507 PARAM_EXT_ACK_DATA::ID => PARAM_EXT_ACK_DATA::EXTRA_CRC,
34508 PARAM_EXT_REQUEST_LIST_DATA::ID => PARAM_EXT_REQUEST_LIST_DATA::EXTRA_CRC,
34509 PARAM_EXT_REQUEST_READ_DATA::ID => PARAM_EXT_REQUEST_READ_DATA::EXTRA_CRC,
34510 PARAM_EXT_SET_DATA::ID => PARAM_EXT_SET_DATA::EXTRA_CRC,
34511 PARAM_EXT_VALUE_DATA::ID => PARAM_EXT_VALUE_DATA::EXTRA_CRC,
34512 PARAM_MAP_RC_DATA::ID => PARAM_MAP_RC_DATA::EXTRA_CRC,
34513 PARAM_REQUEST_LIST_DATA::ID => PARAM_REQUEST_LIST_DATA::EXTRA_CRC,
34514 PARAM_REQUEST_READ_DATA::ID => PARAM_REQUEST_READ_DATA::EXTRA_CRC,
34515 PARAM_SET_DATA::ID => PARAM_SET_DATA::EXTRA_CRC,
34516 PARAM_VALUE_DATA::ID => PARAM_VALUE_DATA::EXTRA_CRC,
34517 PING_DATA::ID => PING_DATA::EXTRA_CRC,
34518 PLAY_TUNE_DATA::ID => PLAY_TUNE_DATA::EXTRA_CRC,
34519 PLAY_TUNE_V2_DATA::ID => PLAY_TUNE_V2_DATA::EXTRA_CRC,
34520 POSITION_TARGET_GLOBAL_INT_DATA::ID => POSITION_TARGET_GLOBAL_INT_DATA::EXTRA_CRC,
34521 POSITION_TARGET_LOCAL_NED_DATA::ID => POSITION_TARGET_LOCAL_NED_DATA::EXTRA_CRC,
34522 POWER_STATUS_DATA::ID => POWER_STATUS_DATA::EXTRA_CRC,
34523 PROTOCOL_VERSION_DATA::ID => PROTOCOL_VERSION_DATA::EXTRA_CRC,
34524 RADIO_STATUS_DATA::ID => RADIO_STATUS_DATA::EXTRA_CRC,
34525 RAW_IMU_DATA::ID => RAW_IMU_DATA::EXTRA_CRC,
34526 RAW_PRESSURE_DATA::ID => RAW_PRESSURE_DATA::EXTRA_CRC,
34527 RAW_RPM_DATA::ID => RAW_RPM_DATA::EXTRA_CRC,
34528 RC_CHANNELS_DATA::ID => RC_CHANNELS_DATA::EXTRA_CRC,
34529 RC_CHANNELS_OVERRIDE_DATA::ID => RC_CHANNELS_OVERRIDE_DATA::EXTRA_CRC,
34530 RC_CHANNELS_RAW_DATA::ID => RC_CHANNELS_RAW_DATA::EXTRA_CRC,
34531 RC_CHANNELS_SCALED_DATA::ID => RC_CHANNELS_SCALED_DATA::EXTRA_CRC,
34532 REQUEST_DATA_STREAM_DATA::ID => REQUEST_DATA_STREAM_DATA::EXTRA_CRC,
34533 REQUEST_EVENT_DATA::ID => REQUEST_EVENT_DATA::EXTRA_CRC,
34534 RESOURCE_REQUEST_DATA::ID => RESOURCE_REQUEST_DATA::EXTRA_CRC,
34535 RESPONSE_EVENT_ERROR_DATA::ID => RESPONSE_EVENT_ERROR_DATA::EXTRA_CRC,
34536 SAFETY_ALLOWED_AREA_DATA::ID => SAFETY_ALLOWED_AREA_DATA::EXTRA_CRC,
34537 SAFETY_SET_ALLOWED_AREA_DATA::ID => SAFETY_SET_ALLOWED_AREA_DATA::EXTRA_CRC,
34538 SCALED_IMU_DATA::ID => SCALED_IMU_DATA::EXTRA_CRC,
34539 SCALED_IMU2_DATA::ID => SCALED_IMU2_DATA::EXTRA_CRC,
34540 SCALED_IMU3_DATA::ID => SCALED_IMU3_DATA::EXTRA_CRC,
34541 SCALED_PRESSURE_DATA::ID => SCALED_PRESSURE_DATA::EXTRA_CRC,
34542 SCALED_PRESSURE2_DATA::ID => SCALED_PRESSURE2_DATA::EXTRA_CRC,
34543 SCALED_PRESSURE3_DATA::ID => SCALED_PRESSURE3_DATA::EXTRA_CRC,
34544 SCRIPT_COUNT_DATA::ID => SCRIPT_COUNT_DATA::EXTRA_CRC,
34545 SCRIPT_CURRENT_DATA::ID => SCRIPT_CURRENT_DATA::EXTRA_CRC,
34546 SCRIPT_ITEM_DATA::ID => SCRIPT_ITEM_DATA::EXTRA_CRC,
34547 SCRIPT_REQUEST_DATA::ID => SCRIPT_REQUEST_DATA::EXTRA_CRC,
34548 SCRIPT_REQUEST_LIST_DATA::ID => SCRIPT_REQUEST_LIST_DATA::EXTRA_CRC,
34549 SERIAL_CONTROL_DATA::ID => SERIAL_CONTROL_DATA::EXTRA_CRC,
34550 SERVO_OUTPUT_RAW_DATA::ID => SERVO_OUTPUT_RAW_DATA::EXTRA_CRC,
34551 SETUP_SIGNING_DATA::ID => SETUP_SIGNING_DATA::EXTRA_CRC,
34552 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => SET_ACTUATOR_CONTROL_TARGET_DATA::EXTRA_CRC,
34553 SET_ATTITUDE_TARGET_DATA::ID => SET_ATTITUDE_TARGET_DATA::EXTRA_CRC,
34554 SET_GPS_GLOBAL_ORIGIN_DATA::ID => SET_GPS_GLOBAL_ORIGIN_DATA::EXTRA_CRC,
34555 SET_HOME_POSITION_DATA::ID => SET_HOME_POSITION_DATA::EXTRA_CRC,
34556 SET_MODE_DATA::ID => SET_MODE_DATA::EXTRA_CRC,
34557 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => {
34558 SET_POSITION_TARGET_GLOBAL_INT_DATA::EXTRA_CRC
34559 }
34560 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => SET_POSITION_TARGET_LOCAL_NED_DATA::EXTRA_CRC,
34561 SIM_STATE_DATA::ID => SIM_STATE_DATA::EXTRA_CRC,
34562 SMART_BATTERY_INFO_DATA::ID => SMART_BATTERY_INFO_DATA::EXTRA_CRC,
34563 STATUSTEXT_DATA::ID => STATUSTEXT_DATA::EXTRA_CRC,
34564 STORAGE_INFORMATION_DATA::ID => STORAGE_INFORMATION_DATA::EXTRA_CRC,
34565 SUPPORTED_TUNES_DATA::ID => SUPPORTED_TUNES_DATA::EXTRA_CRC,
34566 SYSTEM_TIME_DATA::ID => SYSTEM_TIME_DATA::EXTRA_CRC,
34567 SYS_STATUS_DATA::ID => SYS_STATUS_DATA::EXTRA_CRC,
34568 TERRAIN_CHECK_DATA::ID => TERRAIN_CHECK_DATA::EXTRA_CRC,
34569 TERRAIN_DATA_DATA::ID => TERRAIN_DATA_DATA::EXTRA_CRC,
34570 TERRAIN_REPORT_DATA::ID => TERRAIN_REPORT_DATA::EXTRA_CRC,
34571 TERRAIN_REQUEST_DATA::ID => TERRAIN_REQUEST_DATA::EXTRA_CRC,
34572 TIMESYNC_DATA::ID => TIMESYNC_DATA::EXTRA_CRC,
34573 TIME_ESTIMATE_TO_TARGET_DATA::ID => TIME_ESTIMATE_TO_TARGET_DATA::EXTRA_CRC,
34574 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
34575 TRAJECTORY_REPRESENTATION_BEZIER_DATA::EXTRA_CRC
34576 }
34577 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
34578 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::EXTRA_CRC
34579 }
34580 TUNNEL_DATA::ID => TUNNEL_DATA::EXTRA_CRC,
34581 UAVCAN_NODE_INFO_DATA::ID => UAVCAN_NODE_INFO_DATA::EXTRA_CRC,
34582 UAVCAN_NODE_STATUS_DATA::ID => UAVCAN_NODE_STATUS_DATA::EXTRA_CRC,
34583 UTM_GLOBAL_POSITION_DATA::ID => UTM_GLOBAL_POSITION_DATA::EXTRA_CRC,
34584 V2_EXTENSION_DATA::ID => V2_EXTENSION_DATA::EXTRA_CRC,
34585 VFR_HUD_DATA::ID => VFR_HUD_DATA::EXTRA_CRC,
34586 VIBRATION_DATA::ID => VIBRATION_DATA::EXTRA_CRC,
34587 VICON_POSITION_ESTIMATE_DATA::ID => VICON_POSITION_ESTIMATE_DATA::EXTRA_CRC,
34588 VIDEO_STREAM_INFORMATION_DATA::ID => VIDEO_STREAM_INFORMATION_DATA::EXTRA_CRC,
34589 VIDEO_STREAM_STATUS_DATA::ID => VIDEO_STREAM_STATUS_DATA::EXTRA_CRC,
34590 VISION_POSITION_ESTIMATE_DATA::ID => VISION_POSITION_ESTIMATE_DATA::EXTRA_CRC,
34591 VISION_SPEED_ESTIMATE_DATA::ID => VISION_SPEED_ESTIMATE_DATA::EXTRA_CRC,
34592 WHEEL_DISTANCE_DATA::ID => WHEEL_DISTANCE_DATA::EXTRA_CRC,
34593 WIFI_CONFIG_AP_DATA::ID => WIFI_CONFIG_AP_DATA::EXTRA_CRC,
34594 WINCH_STATUS_DATA::ID => WINCH_STATUS_DATA::EXTRA_CRC,
34595 WIND_COV_DATA::ID => WIND_COV_DATA::EXTRA_CRC,
34596 _ => 0,
34597 }
34598 }
34599 fn target_system_id(&self) -> Option<u8> {
34600 match self {
34601 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(inner) => Some(inner.target_system),
34602 Self::CANFD_FRAME(inner) => Some(inner.target_system),
34603 Self::CAN_FILTER_MODIFY(inner) => Some(inner.target_system),
34604 Self::CAN_FRAME(inner) => Some(inner.target_system),
34605 Self::CHANGE_OPERATOR_CONTROL(inner) => Some(inner.target_system),
34606 Self::COMMAND_ACK(inner) => Some(inner.target_system),
34607 Self::COMMAND_CANCEL(inner) => Some(inner.target_system),
34608 Self::COMMAND_INT(inner) => Some(inner.target_system),
34609 Self::COMMAND_LONG(inner) => Some(inner.target_system),
34610 Self::FILE_TRANSFER_PROTOCOL(inner) => Some(inner.target_system),
34611 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(inner) => Some(inner.target_system),
34612 Self::GIMBAL_DEVICE_SET_ATTITUDE(inner) => Some(inner.target_system),
34613 Self::GIMBAL_MANAGER_SET_ATTITUDE(inner) => Some(inner.target_system),
34614 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(inner) => Some(inner.target_system),
34615 Self::GIMBAL_MANAGER_SET_PITCHYAW(inner) => Some(inner.target_system),
34616 Self::GPS_INJECT_DATA(inner) => Some(inner.target_system),
34617 Self::LOGGING_ACK(inner) => Some(inner.target_system),
34618 Self::LOGGING_DATA(inner) => Some(inner.target_system),
34619 Self::LOGGING_DATA_ACKED(inner) => Some(inner.target_system),
34620 Self::LOG_ERASE(inner) => Some(inner.target_system),
34621 Self::LOG_REQUEST_DATA(inner) => Some(inner.target_system),
34622 Self::LOG_REQUEST_END(inner) => Some(inner.target_system),
34623 Self::LOG_REQUEST_LIST(inner) => Some(inner.target_system),
34624 Self::MISSION_ACK(inner) => Some(inner.target_system),
34625 Self::MISSION_CLEAR_ALL(inner) => Some(inner.target_system),
34626 Self::MISSION_COUNT(inner) => Some(inner.target_system),
34627 Self::MISSION_ITEM(inner) => Some(inner.target_system),
34628 Self::MISSION_ITEM_INT(inner) => Some(inner.target_system),
34629 Self::MISSION_REQUEST(inner) => Some(inner.target_system),
34630 Self::MISSION_REQUEST_INT(inner) => Some(inner.target_system),
34631 Self::MISSION_REQUEST_LIST(inner) => Some(inner.target_system),
34632 Self::MISSION_REQUEST_PARTIAL_LIST(inner) => Some(inner.target_system),
34633 Self::MISSION_SET_CURRENT(inner) => Some(inner.target_system),
34634 Self::MISSION_WRITE_PARTIAL_LIST(inner) => Some(inner.target_system),
34635 Self::OPEN_DRONE_ID_AUTHENTICATION(inner) => Some(inner.target_system),
34636 Self::OPEN_DRONE_ID_BASIC_ID(inner) => Some(inner.target_system),
34637 Self::OPEN_DRONE_ID_LOCATION(inner) => Some(inner.target_system),
34638 Self::OPEN_DRONE_ID_MESSAGE_PACK(inner) => Some(inner.target_system),
34639 Self::OPEN_DRONE_ID_OPERATOR_ID(inner) => Some(inner.target_system),
34640 Self::OPEN_DRONE_ID_SELF_ID(inner) => Some(inner.target_system),
34641 Self::OPEN_DRONE_ID_SYSTEM(inner) => Some(inner.target_system),
34642 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(inner) => Some(inner.target_system),
34643 Self::PARAM_EXT_REQUEST_LIST(inner) => Some(inner.target_system),
34644 Self::PARAM_EXT_REQUEST_READ(inner) => Some(inner.target_system),
34645 Self::PARAM_EXT_SET(inner) => Some(inner.target_system),
34646 Self::PARAM_MAP_RC(inner) => Some(inner.target_system),
34647 Self::PARAM_REQUEST_LIST(inner) => Some(inner.target_system),
34648 Self::PARAM_REQUEST_READ(inner) => Some(inner.target_system),
34649 Self::PARAM_SET(inner) => Some(inner.target_system),
34650 Self::PING(inner) => Some(inner.target_system),
34651 Self::PLAY_TUNE(inner) => Some(inner.target_system),
34652 Self::PLAY_TUNE_V2(inner) => Some(inner.target_system),
34653 Self::RC_CHANNELS_OVERRIDE(inner) => Some(inner.target_system),
34654 Self::REQUEST_DATA_STREAM(inner) => Some(inner.target_system),
34655 Self::REQUEST_EVENT(inner) => Some(inner.target_system),
34656 Self::RESPONSE_EVENT_ERROR(inner) => Some(inner.target_system),
34657 Self::SAFETY_SET_ALLOWED_AREA(inner) => Some(inner.target_system),
34658 Self::SCRIPT_COUNT(inner) => Some(inner.target_system),
34659 Self::SCRIPT_ITEM(inner) => Some(inner.target_system),
34660 Self::SCRIPT_REQUEST(inner) => Some(inner.target_system),
34661 Self::SCRIPT_REQUEST_LIST(inner) => Some(inner.target_system),
34662 Self::SERIAL_CONTROL(inner) => Some(inner.target_system),
34663 Self::SETUP_SIGNING(inner) => Some(inner.target_system),
34664 Self::SET_ACTUATOR_CONTROL_TARGET(inner) => Some(inner.target_system),
34665 Self::SET_ATTITUDE_TARGET(inner) => Some(inner.target_system),
34666 Self::SET_GPS_GLOBAL_ORIGIN(inner) => Some(inner.target_system),
34667 Self::SET_HOME_POSITION(inner) => Some(inner.target_system),
34668 Self::SET_MODE(inner) => Some(inner.target_system),
34669 Self::SET_POSITION_TARGET_GLOBAL_INT(inner) => Some(inner.target_system),
34670 Self::SET_POSITION_TARGET_LOCAL_NED(inner) => Some(inner.target_system),
34671 Self::SUPPORTED_TUNES(inner) => Some(inner.target_system),
34672 Self::TIMESYNC(inner) => Some(inner.target_system),
34673 Self::TUNNEL(inner) => Some(inner.target_system),
34674 Self::V2_EXTENSION(inner) => Some(inner.target_system),
34675 _ => None,
34676 }
34677 }
34678 fn target_component_id(&self) -> Option<u8> {
34679 match self {
34680 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(inner) => Some(inner.target_component),
34681 Self::CANFD_FRAME(inner) => Some(inner.target_component),
34682 Self::CAN_FILTER_MODIFY(inner) => Some(inner.target_component),
34683 Self::CAN_FRAME(inner) => Some(inner.target_component),
34684 Self::COMMAND_ACK(inner) => Some(inner.target_component),
34685 Self::COMMAND_CANCEL(inner) => Some(inner.target_component),
34686 Self::COMMAND_INT(inner) => Some(inner.target_component),
34687 Self::COMMAND_LONG(inner) => Some(inner.target_component),
34688 Self::FILE_TRANSFER_PROTOCOL(inner) => Some(inner.target_component),
34689 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(inner) => Some(inner.target_component),
34690 Self::GIMBAL_DEVICE_SET_ATTITUDE(inner) => Some(inner.target_component),
34691 Self::GIMBAL_MANAGER_SET_ATTITUDE(inner) => Some(inner.target_component),
34692 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(inner) => Some(inner.target_component),
34693 Self::GIMBAL_MANAGER_SET_PITCHYAW(inner) => Some(inner.target_component),
34694 Self::GPS_INJECT_DATA(inner) => Some(inner.target_component),
34695 Self::LOGGING_ACK(inner) => Some(inner.target_component),
34696 Self::LOGGING_DATA(inner) => Some(inner.target_component),
34697 Self::LOGGING_DATA_ACKED(inner) => Some(inner.target_component),
34698 Self::LOG_ERASE(inner) => Some(inner.target_component),
34699 Self::LOG_REQUEST_DATA(inner) => Some(inner.target_component),
34700 Self::LOG_REQUEST_END(inner) => Some(inner.target_component),
34701 Self::LOG_REQUEST_LIST(inner) => Some(inner.target_component),
34702 Self::MISSION_ACK(inner) => Some(inner.target_component),
34703 Self::MISSION_CLEAR_ALL(inner) => Some(inner.target_component),
34704 Self::MISSION_COUNT(inner) => Some(inner.target_component),
34705 Self::MISSION_ITEM(inner) => Some(inner.target_component),
34706 Self::MISSION_ITEM_INT(inner) => Some(inner.target_component),
34707 Self::MISSION_REQUEST(inner) => Some(inner.target_component),
34708 Self::MISSION_REQUEST_INT(inner) => Some(inner.target_component),
34709 Self::MISSION_REQUEST_LIST(inner) => Some(inner.target_component),
34710 Self::MISSION_REQUEST_PARTIAL_LIST(inner) => Some(inner.target_component),
34711 Self::MISSION_SET_CURRENT(inner) => Some(inner.target_component),
34712 Self::MISSION_WRITE_PARTIAL_LIST(inner) => Some(inner.target_component),
34713 Self::OPEN_DRONE_ID_AUTHENTICATION(inner) => Some(inner.target_component),
34714 Self::OPEN_DRONE_ID_BASIC_ID(inner) => Some(inner.target_component),
34715 Self::OPEN_DRONE_ID_LOCATION(inner) => Some(inner.target_component),
34716 Self::OPEN_DRONE_ID_MESSAGE_PACK(inner) => Some(inner.target_component),
34717 Self::OPEN_DRONE_ID_OPERATOR_ID(inner) => Some(inner.target_component),
34718 Self::OPEN_DRONE_ID_SELF_ID(inner) => Some(inner.target_component),
34719 Self::OPEN_DRONE_ID_SYSTEM(inner) => Some(inner.target_component),
34720 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(inner) => Some(inner.target_component),
34721 Self::PARAM_EXT_REQUEST_LIST(inner) => Some(inner.target_component),
34722 Self::PARAM_EXT_REQUEST_READ(inner) => Some(inner.target_component),
34723 Self::PARAM_EXT_SET(inner) => Some(inner.target_component),
34724 Self::PARAM_MAP_RC(inner) => Some(inner.target_component),
34725 Self::PARAM_REQUEST_LIST(inner) => Some(inner.target_component),
34726 Self::PARAM_REQUEST_READ(inner) => Some(inner.target_component),
34727 Self::PARAM_SET(inner) => Some(inner.target_component),
34728 Self::PING(inner) => Some(inner.target_component),
34729 Self::PLAY_TUNE(inner) => Some(inner.target_component),
34730 Self::PLAY_TUNE_V2(inner) => Some(inner.target_component),
34731 Self::RC_CHANNELS_OVERRIDE(inner) => Some(inner.target_component),
34732 Self::REQUEST_DATA_STREAM(inner) => Some(inner.target_component),
34733 Self::REQUEST_EVENT(inner) => Some(inner.target_component),
34734 Self::RESPONSE_EVENT_ERROR(inner) => Some(inner.target_component),
34735 Self::SAFETY_SET_ALLOWED_AREA(inner) => Some(inner.target_component),
34736 Self::SCRIPT_COUNT(inner) => Some(inner.target_component),
34737 Self::SCRIPT_ITEM(inner) => Some(inner.target_component),
34738 Self::SCRIPT_REQUEST(inner) => Some(inner.target_component),
34739 Self::SCRIPT_REQUEST_LIST(inner) => Some(inner.target_component),
34740 Self::SERIAL_CONTROL(inner) => Some(inner.target_component),
34741 Self::SETUP_SIGNING(inner) => Some(inner.target_component),
34742 Self::SET_ACTUATOR_CONTROL_TARGET(inner) => Some(inner.target_component),
34743 Self::SET_ATTITUDE_TARGET(inner) => Some(inner.target_component),
34744 Self::SET_POSITION_TARGET_GLOBAL_INT(inner) => Some(inner.target_component),
34745 Self::SET_POSITION_TARGET_LOCAL_NED(inner) => Some(inner.target_component),
34746 Self::SUPPORTED_TUNES(inner) => Some(inner.target_component),
34747 Self::TIMESYNC(inner) => Some(inner.target_component),
34748 Self::TUNNEL(inner) => Some(inner.target_component),
34749 Self::V2_EXTENSION(inner) => Some(inner.target_component),
34750 _ => None,
34751 }
34752 }
34753}